openinx commented on a change in pull request #2364:
URL: https://github.com/apache/iceberg/pull/2364#discussion_r678154275



##########
File path: data/src/main/java/org/apache/iceberg/data/DeleteFilter.java
##########
@@ -96,6 +98,29 @@ public Schema requiredSchema() {
     return requiredSchema;
   }
 
+  protected int deleteMarkerIndex() {
+    if (deleteMarkerIndex != null) {
+      return deleteMarkerIndex;
+    }
+
+    int index = 0;
+    for (Types.NestedField field : requiredSchema().columns()) {
+      if (field.fieldId() != MetadataColumns.IS_DELETED.fieldId()) {
+        index = index + 1;
+      } else {
+        break;
+      }
+    }
+
+    deleteMarkerIndex = index;
+
+    return deleteMarkerIndex;
+  }
+
+  protected abstract Consumer<T> deleteMarker();

Review comment:
       How about introducing a new interface named `Setter` to set the 
`is_deleted` flag (which is similar to the org.apache.iceberg.Accessor)  so 
that we could have a good abstraction to hide the delete marker logic: 
   
   ```java
     interface Setter<T> extends Serializable {
       T set(T reuse);
     }
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to