RussellSpitzer commented on a change in pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375#discussion_r476629486
##########
File path:
spark/src/main/java/org/apache/iceberg/actions/ExpireSnapshotsAction.java
##########
@@ -146,32 +147,48 @@ public ExpireSnapshotsAction deleteWith(Consumer<String>
newDeleteFunc) {
return this;
}
- @Override
- public ExpireSnapshotsActionResult execute() {
- // Metadata before Expiration
- Dataset<Row> originalFiles = buildValidFileDF(ops.current());
+ /**
+ * Expires snapshots and commits the changes to the table, returning a
Dataset of files to delete.
+ * <p>
+ * This does not delete data files. To delete data files, run {@link
#execute()}.
+ * <p>
+ * This may be called before or after {@link #execute()} is called to return
the expired file list.
+ *
+ * @return a Dataset of files that are no longer referenced by the table
+ */
+ public Dataset<Row> expire() {
+ if (expiredFiles == null) {
Review comment:
Should we be synchronizing on expired files? Probably a really unlikely
situation to be calling this object in a multi-threaded way or to call expire
and execute concurrently ...
----------------------------------------------------------------
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]