aokolnychyi commented on a change in pull request #1874:
URL: https://github.com/apache/iceberg/pull/1874#discussion_r536139397
##########
File path:
spark3/src/main/java/org/apache/iceberg/spark/procedures/ExpireSnapshotsProcedure.java
##########
@@ -96,6 +75,36 @@ public StructType outputType() {
return OUTPUT_TYPE;
}
+ @Override
+ public InternalRow[] call(InternalRow args) {
+ String namespace = args.getString(0);
+ String tableName = args.getString(1);
+ Long olderThanMillis = args.isNullAt(2) ? null :
DateTimeUtils.toMillis(args.getLong(2));
+ Integer retainLastNum = args.isNullAt(3) ? null : args.getInt(3);
+
+ return modifyIcebergTable(namespace, tableName, table -> {
+ Actions actions = Actions.forTable(table);
+
+ ExpireSnapshotsAction action = actions.expireSnapshots();
+
+ if (olderThanMillis != null) {
+ action.expireOlderThan(olderThanMillis);
Review comment:
The action delegates to `ExpireSnapshots` table API that, in turn,
respects the default table props we added recently.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]