yihua commented on code in PR #9892:
URL: https://github.com/apache/hudi/pull/9892#discussion_r1366228172
##########
hudi-common/src/main/java/org/apache/hudi/common/model/DefaultHoodieRecordPayload.java:
##########
@@ -86,30 +86,27 @@ public Option<IndexedRecord> getInsertValue(Schema schema,
Properties properties
GenericRecord incomingRecord = HoodieAvroUtils.bytesToAvro(recordBytes,
schema);
eventTime = updateEventTime(incomingRecord, properties);
- return isDeleteRecord(incomingRecord, properties) ? Option.empty() :
Option.of(incomingRecord);
+ return isDeleted(schema, properties) ? Option.empty() :
Option.of(incomingRecord);
Review Comment:
Yes, this is to avoid double parsing. After the instantiation, whether the
record is a delete record is already determined, stored in `isDeletedRecord`,
and `isDeleted(schema, properties)` returns the result.
```
/**
* Defines whether this implementation of {@link HoodieRecordPayload} is
deleted.
* We will not do deserialization in this method.
*/
public boolean isDeleted(Schema schema, Properties props) {
return isDeletedRecord;
}
```
--
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]