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 2022/05/11 18:12:57 UTC

[GitHub] [iceberg] szehon-ho commented on a diff in pull request #4674: Spark-3.2: Avoid duplicate computation of ALL_MANIFESTS metadata table for spark actions

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: issues-unsubscribe@iceberg.apache.org

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