linliu-code commented on code in PR #12597:
URL: https://github.com/apache/hudi/pull/12597#discussion_r1931351771
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/common/model/HoodieSparkRecord.java:
##########
@@ -230,22 +232,37 @@ public boolean isDelete(Schema recordSchema, Properties
props) {
if (null == data) {
return true;
}
-
// Use metadata filed to decide.
Schema.Field operationField =
recordSchema.getField(OPERATION_METADATA_FIELD);
if (null != operationField
&& HoodieOperation.isDeleteRecord((String)
data.get(operationField.pos(), StringType))) {
return true;
}
-
// Use data field to decide.
- if (recordSchema.getField(HOODIE_IS_DELETED_FIELD) == null) {
- return false;
+ if (recordSchema.getField(HOODIE_IS_DELETED_FIELD) != null) {
+ Object deleteMarker = data.get(
+ recordSchema.getField(HOODIE_IS_DELETED_FIELD).pos(), BooleanType);
+ if (deleteMarker instanceof Boolean && (boolean) deleteMarker) {
+ return true;
+ }
}
+ // Use custom field to decide.
+ return isCustomDeleteRecord(recordSchema, props);
Review Comment:
I dont' see the differences; but I can move it there. Can you explain on the
reason?
--
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]