aokolnychyi commented on code in PR #8289:
URL: https://github.com/apache/iceberg/pull/8289#discussion_r1294879207


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/procedures/RewritePositionDeleteFilesProcedure.java:
##########
@@ -85,15 +92,34 @@ public InternalRow[] call(InternalRow args) {
     ProcedureInput input = new ProcedureInput(spark(), tableCatalog(), 
PARAMETERS, args);
     Identifier tableIdent = input.ident(TABLE_PARAM);
     Map<String, String> options = input.asStringMap(OPTIONS_PARAM, 
ImmutableMap.of());
+    String where = input.asString(WHERE_PARAM, null);
 
     return modifyIcebergTable(
         tableIdent,
         table -> {
-          Result result = 
actions().rewritePositionDeletes(table).options(options).execute();
+          RewritePositionDeleteFiles action =
+              actions().rewritePositionDeletes(table).options(options);
+          action = checkAndApplyFilter(action, where, tableIdent);
+          Result result = action.execute();
           return new InternalRow[] {toOutputRow(result)};
         });
   }
 
+  private RewritePositionDeleteFiles checkAndApplyFilter(

Review Comment:
   I would make this method be responsible for parsing and converting the 
filter clause only. I would also consider maybe adding support for this kind of 
parsing and conversion logic to `ProcedureInput`. Is that feasible?



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