diff --git a/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieCreateHandle.java b/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieCreateHandle.java index c677ad388..5ff356171 100644 --- a/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieCreateHandle.java +++ b/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieCreateHandle.java @@ -50,7 +50,7 @@ public class HoodieCreateHandle extends HoodieIOH private long insertRecordsWritten = 0; private long recordsDeleted = 0; private Iterator> recordIterator; - private boolean useWriterSchema; + private boolean useWriterSchema = false; public HoodieCreateHandle(HoodieWriteConfig config, String commitTime, HoodieTable hoodieTable, String partitionPath, String fileId) { @@ -78,6 +78,9 @@ public class HoodieCreateHandle extends HoodieIOH logger.info("New InsertHandle for partition :" + partitionPath + " with fileId " + fileId); } + /** + * Called by the compactor code path + */ public HoodieCreateHandle(HoodieWriteConfig config, String commitTime, HoodieTable hoodieTable, String partitionPath, String fileId, Iterator> recordIterator) { this(config, commitTime, hoodieTable, partitionPath, fileId); diff --git a/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieMergeHandle.java b/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieMergeHandle.java index 1ad8b0f51..3beb97d53 100644 --- a/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieMergeHandle.java +++ b/hoodie-client/src/main/java/com/uber/hoodie/io/HoodieMergeHandle.java @@ -76,6 +76,9 @@ public class HoodieMergeHandle extends HoodieIOHa .filter(dataFile -> dataFile.getFileId().equals(fileId)).findFirst()); } + /** + * Called by compactor code path + */ public HoodieMergeHandle(HoodieWriteConfig config, String commitTime, HoodieTable hoodieTable, Map> keyToNewRecords, String fileId, Optional dataFileToBeMerged) { super(config, commitTime, hoodieTable); diff --git a/hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java b/hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java index c2a05c9a6..838ea8634 100644 --- a/hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java +++ b/hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java @@ -30,17 +30,11 @@ import org.apache.avro.generic.GenericRecord; */ public abstract class BaseAvroPayload implements Serializable { - /** * Avro data extracted from the source converted to bytes */ protected final byte [] recordBytes; - /** - * The schema of the Avro data - */ - protected final String schemaStr; - /** * For purposes of preCombining */ @@ -53,7 +47,6 @@ public abstract class BaseAvroPayload implements Serializable { public BaseAvroPayload(GenericRecord record, Comparable orderingVal) { try { this.recordBytes = HoodieAvroUtils.avroToBytes(record); - this.schemaStr = record.getSchema().toString(); } catch (IOException io) { throw new HoodieIOException("Cannot convert GenericRecord to bytes", io); }