RussellSpitzer commented on code in PR #6581: URL: https://github.com/apache/iceberg/pull/6581#discussion_r1072837947
########## spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/BaseSparkAction.java: ########## @@ -361,4 +368,25 @@ static FileInfo toFileInfo(ContentFile<?> file) { return new FileInfo(file.path().toString(), file.content().toString()); } } + + protected <T, U> U withReusableDS(Dataset<T> ds, Function<Dataset<T>, U> func) { + Dataset<T> reusableDS; + boolean useCaching = + PropertyUtil.propertyAsBoolean(options(), USE_CACHING, USE_CACHING_DEFAULT); + if (useCaching) { + reusableDS = ds.cache(); + } else { + int parallelism = SQLConf.get().numShufflePartitions(); Review Comment: This is a bit internal to spark, probably fine but i'm not a fan of touching this over spark.conf() -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org