wzx140 commented on code in PR #7021:
URL: https://github.com/apache/hudi/pull/7021#discussion_r1024786040
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecord.java:
##########
@@ -133,23 +143,29 @@ public HoodieRecord updateMetadataValues(Schema
recordSchema, Properties props,
}
});
- return new HoodieAvroRecord<>(getKey(), new
RewriteAvroPayload(avroRecordPayload), getOperation());
+ return new HoodieAvroRecord<>(getKey(), new
RewriteAvroPayload(avroRecordPayload), getOperation(), this.currentLocation,
this.newLocation);
}
@Override
public HoodieRecord truncateRecordKey(Schema recordSchema, Properties props,
String keyFieldName) throws IOException {
GenericRecord avroRecordPayload = (GenericRecord)
getData().getInsertValue(recordSchema, props).get();
avroRecordPayload.put(keyFieldName, StringUtils.EMPTY_STRING);
- return new HoodieAvroRecord<>(getKey(), new
RewriteAvroPayload(avroRecordPayload), getOperation());
+ return new HoodieAvroRecord<>(getKey(), new
RewriteAvroPayload(avroRecordPayload), getOperation(), this.currentLocation,
this.newLocation);
}
@Override
public boolean isDelete(Schema recordSchema, Properties props) throws
IOException {
+ if (!(data instanceof HoodieAvroInsertValuePayload) && !(data instanceof
RewriteAvroPayload)) {
+ throw new HoodieException("We should deserialization before calling
isDelete");
Review Comment:
HoodieAvroRecord#isDelete or shouldIgnore will deserialize HoodiePayload.
And we will deserialize it again when we write it to the file. So we should
call deserialization before calling them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]