yadavay-amzn commented on code in PR #17016:
URL: https://github.com/apache/iceberg/pull/17016#discussion_r3540604078


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestSparkWriteConf.java:
##########
@@ -629,6 +629,21 @@ private void testWriteProperties(List<Map<String, String>> 
propertiesSuite) {
         });
   }
 
+  @TestTemplate
+  public void testExtraSnapshotMetadataOnMetadataOnlyDelete() {
+    sql(
+        "INSERT INTO %s VALUES (1, 'a', DATE '2021-01-01', TIMESTAMP 
'2021-01-01 00:00:00')",
+        tableName);
+
+    withSQLConf(
+        ImmutableMap.of("spark.sql.iceberg.snapshot-property.test-key", 
"test-value"),
+        () -> {
+          sql("DELETE FROM %s WHERE date = DATE '2021-01-01'", tableName);
+          Table table = validationCatalog.loadTable(tableIdent);
+          
assertThat(table.currentSnapshot().summary()).containsEntry("test-key", 
"test-value");

Review Comment:
   Strengthened the test to pin the metadata-only path per your suggestion: it 
now asserts the snapshot operation is DELETE (a row-level copy-on-write would 
produce OVERWRITE), that the summary has no added-data-files key (Iceberg's 
SnapshotSummary only emits it when the count is greater than 0, so its absence 
confirms nothing was rewritten), and that deleted-data-files is present. A 
regression into the row-level path would now fail these assertions.



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