This is an automated email from the ASF dual-hosted git repository.
vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hudi.git
The following commit(s) were added to refs/heads/master by this push:
new e56c161 Fixed HUDI-87 : Remove schemastr from BaseAvroPayload
e56c161 is described below
commit e56c1612e46ba831f45c1ce8ee9fc2694933e2d5
Author: Vinoth Chandar <[email protected]>
AuthorDate: Wed Mar 27 15:47:49 2019 -0700
Fixed HUDI-87 : Remove schemastr from BaseAvroPayload
---
.../src/main/java/com/uber/hoodie/io/HoodieCreateHandle.java | 5 ++++-
.../src/main/java/com/uber/hoodie/io/HoodieMergeHandle.java | 3 +++
hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java | 7 -------
3 files changed, 7 insertions(+), 8 deletions(-)
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 c677ad3..5ff3561 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<T extends
HoodieRecordPayload> extends HoodieIOH
private long insertRecordsWritten = 0;
private long recordsDeleted = 0;
private Iterator<HoodieRecord<T>> recordIterator;
- private boolean useWriterSchema;
+ private boolean useWriterSchema = false;
public HoodieCreateHandle(HoodieWriteConfig config, String commitTime,
HoodieTable<T> hoodieTable,
String partitionPath, String fileId) {
@@ -78,6 +78,9 @@ public class HoodieCreateHandle<T extends
HoodieRecordPayload> 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<T> hoodieTable,
String partitionPath, String fileId, Iterator<HoodieRecord<T>>
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 1ad8b0f..3beb97d 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<T extends HoodieRecordPayload>
extends HoodieIOHa
.filter(dataFile ->
dataFile.getFileId().equals(fileId)).findFirst());
}
+ /**
+ * Called by compactor code path
+ */
public HoodieMergeHandle(HoodieWriteConfig config, String commitTime,
HoodieTable<T> hoodieTable,
Map<String, HoodieRecord<T>> keyToNewRecords, String fileId,
Optional<HoodieDataFile> 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 c2a05c9..838ea86 100644
--- a/hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java
+++ b/hoodie-spark/src/main/java/com/uber/hoodie/BaseAvroPayload.java
@@ -30,18 +30,12 @@ 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
*/
protected final Comparable orderingVal;
@@ -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);
}