danny0405 commented on code in PR #10150:
URL: https://github.com/apache/hudi/pull/10150#discussion_r1401397731
##########
hudi-common/src/main/java/org/apache/hudi/common/model/DefaultHoodieRecordPayload.java:
##########
@@ -89,6 +90,18 @@ public Option<IndexedRecord> getInsertValue(Schema schema,
Properties properties
return isDeleteRecord(incomingRecord, properties) ? Option.empty() :
Option.of(incomingRecord);
}
+ public boolean isDeleted(Schema schema, Properties props) {
+ if (recordBytes.length == 0) {
+ return true;
+ }
+ try {
+ GenericRecord incomingRecord = HoodieAvroUtils.bytesToAvro(recordBytes,
schema);
+ return isDeleteRecord(incomingRecord, props);
Review Comment:
I feel like we can cache the avro generic record for a little while for the
`isDeleted` call based on the fact that the `isDeleted` should always be
invoked before `getInsertValue` and `combineAndGetUpdateValue`, we can destroy
the avro record in the last step of calling `getInsertValue`, that would
eliminate 2 deserializations of avro.
Another choice is we just cache a specific `isDeleted` flag for this
`DefaultHoodieRecordPayload` so that this flag can be reused all the time.
--
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]