huan233usc commented on code in PR #17016:
URL: https://github.com/apache/iceberg/pull/17016#discussion_r3510321147


##########
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:
   Thanks for adding coverage here! One small thing: since the table is 
`PARTITIONED BY (date, ...)` and the predicate deletes a whole partition, this 
should route through the new metadata-only `deleteWhere` path — but a row-level 
DELETE would satisfy this same assertion via the existing 
`SparkWrite`/`SparkPositionDeltaWrite` handling, so the test wouldn't 
necessarily catch a regression in the new code. Could we also assert something 
that pins it to the metadata-only path, e.g. `added-data-files == 0` in the 
summary? Otherwise looks good.



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