szehon-ho commented on code in PR #8289:
URL: https://github.com/apache/iceberg/pull/8289#discussion_r1294976245
##########
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:
Yea initially I just copied from RewriteDataFilesProcedure, which was doing
more than one thing. Also thought it a bit weird, but thought to keep it
consistent.
Refacotred as suggested.
--
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]