You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/25 19:36:58 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1375: Add expire method to ExpireSnapshotsAction

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org