rdblue commented on a change in pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375#discussion_r476690945



##########
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:
       I'd rather not over-complicate it. If there is a future use case for 
multiple threads we can do it then, but I really doubt it will be needed.




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

Reply via email to