szehon-ho commented on code in PR #4674:
URL: https://github.com/apache/iceberg/pull/4674#discussion_r870613204


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/actions/BaseDeleteReachableFilesSparkAction.java:
##########
@@ -116,17 +122,27 @@ private Result doExecute() {
     Dataset<Row> reachableFileDF = buildReachableFileDF(metadata).distinct();
 
     boolean streamResults = PropertyUtil.propertyAsBoolean(options(), 
STREAM_RESULTS, STREAM_RESULTS_DEFAULT);
+    Result result;
     if (streamResults) {
-      return deleteFiles(reachableFileDF.toLocalIterator());
+      result = deleteFiles(reachableFileDF.toLocalIterator());
     } else {
-      return deleteFiles(reachableFileDF.collectAsList().iterator());
+      result = deleteFiles(reachableFileDF.collectAsList().iterator());
+    }
+    if (useCaching) {
+      allManifests.unpersist();

Review Comment:
   Yea if we go for this approach, can we do something like in 
https://github.com/apache/iceberg/blob/master/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/actions/BaseRewriteManifestsSparkAction.java#L237.
 (withReusableDS) ?



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

To unsubscribe, e-mail: [email protected]

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