anuragmantri commented on code in PR #18406:
URL: https://github.com/apache/iceberg/pull/18406#discussion_r4212434247


##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/BaseSnapshotUpdateSparkAction.java:
##########
@@ -21,14 +21,21 @@
 import java.util.Map;
 import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
 import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.spark.SparkSQLProperties;
+import org.apache.iceberg.util.PropertyUtil;
 import org.apache.spark.sql.SparkSession;
+import scala.collection.JavaConverters;
 
 abstract class BaseSnapshotUpdateSparkAction<ThisT> extends 
BaseSparkAction<ThisT> {
 
   private final Map<String, String> summary = Maps.newHashMap();
 
   protected BaseSnapshotUpdateSparkAction(SparkSession spark) {
     super(spark);
+    summary.putAll(
+        PropertyUtil.propertiesWithPrefix(
+            JavaConverters.mapAsJavaMap(spark.conf().getAll()),
+            SparkSQLProperties.SNAPSHOT_PROPERTY_PREFIX));

Review Comment:
   For Spark actions, yes. `BaseSnapshotUpdateSparkAction` is the base class of 
all four actions that commit snapshots. `RewriteDataFilesSparkAction`, 
`RewritePositionDeleteFilesSparkAction`, and `RemoveDanglingDeletesSparkAction` 
commit through `commitSummary()`, and `RewriteManifestsSparkAction` commits 
through `commit()`. The tests cover both paths.
   
   A few other places commit snapshots without picking this up:
   - `add_files`, `migrate`, and `snapshot` append through `SparkTableUtil`.
   - `cherrypick_snapshot` and `publish_changes` go through `ManageSnapshots`, 
which has no way to set summary properties, so they would need an API change 
first.
   - Metadata-only `DELETE` is a write-path gap, tracked in #15060.
   
   I'd like to keep this PR to the actions and handle `SparkTableUtil` in a 
follow-up.



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