aokolnychyi commented on a change in pull request #2287:
URL: https://github.com/apache/iceberg/pull/2287#discussion_r593423708



##########
File path: 
spark/src/main/java/org/apache/iceberg/actions/ExpireSnapshotsAction.java
##########
@@ -206,11 +209,16 @@ public ExpireSnapshotsAction deleteWith(Consumer<String> 
newDeleteFunc) {
 
   @Override
   public ExpireSnapshotsActionResult execute() {
-    if (streamResults) {
-      return deleteFiles(expire().toLocalIterator());
-    } else {
-      return deleteFiles(expire().collectAsList().iterator());
-    }
+    SparkContext context = spark().sparkContext();

Review comment:
       Can we simplify this a bit?
   
   ```
     @Override
      public ExpireSnapshotsActionResult execute() {
       JobGroupInfo info = withJobGroupInfo("EXPIRE", "EXPIRE-SNAPSHOTS");
       withJobGroupInfo(info, this::doExecute)
     }
   ```

##########
File path: 
spark/src/main/java/org/apache/iceberg/actions/ExpireSnapshotsAction.java
##########
@@ -206,11 +209,16 @@ public ExpireSnapshotsAction deleteWith(Consumer<String> 
newDeleteFunc) {
 
   @Override
   public ExpireSnapshotsActionResult execute() {
-    if (streamResults) {
-      return deleteFiles(expire().toLocalIterator());
-    } else {
-      return deleteFiles(expire().collectAsList().iterator());
-    }
+    SparkContext context = spark().sparkContext();

Review comment:
       Can we simplify this a bit?
   
   ```
      @Override
      public ExpireSnapshotsActionResult execute() {
       JobGroupInfo info = withJobGroupInfo("EXPIRE", "EXPIRE-SNAPSHOTS");
       withJobGroupInfo(info, this::doExecute)
     }
   ```




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