danny0405 commented on code in PR #8721:
URL: https://github.com/apache/hudi/pull/8721#discussion_r1197636500
##########
hudi-common/src/main/java/org/apache/hudi/common/model/BaseAvroPayload.java:
##########
@@ -85,13 +85,20 @@ public boolean canProduceSentinel() {
*/
protected static boolean isDeleteRecord(GenericRecord genericRecord) {
final String isDeleteKey = HoodieRecord.HOODIE_IS_DELETED_FIELD;
+ final String isDeleteKeyMeta = HoodieRecord.OPERATION_METADATA_FIELD;
// Modify to be compatible with new version Avro.
// The new version Avro throws for GenericRecord.get if the field name
// does not exist in the schema.
- if (genericRecord.getSchema().getField(isDeleteKey) == null) {
- return false;
+ if (genericRecord.getSchema().getField(isDeleteKey) != null) {
+ Object deleteMarker = genericRecord.get(isDeleteKey);
+ return (deleteMarker instanceof Boolean && (boolean) deleteMarker);
}
- Object deleteMarker = genericRecord.get(isDeleteKey);
- return (deleteMarker instanceof Boolean && (boolean) deleteMarker);
+
+ if (genericRecord.getSchema().getField(isDeleteKeyMeta) != null) {
+ Object deleteMarker = genericRecord.get(isDeleteKeyMeta);
+ return (deleteMarker != null && "D".equals(deleteMarker.toString()));
Review Comment:
It affects the usage because the `getInsertValue` returns nothing after your
change, we still need the whole payload for retraction.
--
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]