danny0405 commented on code in PR #11930:
URL: https://github.com/apache/hudi/pull/11930#discussion_r1755884456


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/common/model/HoodieSparkRecord.java:
##########
@@ -237,14 +237,24 @@ public HoodieRecord truncateRecordKey(Schema 
recordSchema, Properties props, Str
   }
 
   @Override
-  public boolean isDelete(Schema recordSchema, Properties props) throws 
IOException {
+  public boolean isDelete(Schema recordSchema, Properties props) {
     if (null == data) {
       return true;
     }
-    if (recordSchema.getField(HoodieRecord.HOODIE_IS_DELETED_FIELD) == null) {
+
+    // Use metadata filed to decide.
+    Schema.Field operationField = 
recordSchema.getField(OPERATION_METADATA_FIELD);
+    if (operationField != null && "D".equals(data.get(operationField.pos(), 
StringType))) {

Review Comment:
   Maybe we can add a utility method `HoodieOperation.isDelete(String opName)` 
instead.



-- 
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]

Reply via email to