amogh-jahagirdar commented on code in PR #15061:
URL: https://github.com/apache/iceberg/pull/15061#discussion_r2743799898
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/TestSparkWriteConf.java:
##########
@@ -631,6 +631,49 @@ private void testWriteProperties(List<Map<String, String>>
propertiesSuite) {
});
}
+ @TestTemplate
+ public void testExtraSnapshotMetadataPersistedOnRowLevelDelete() {
+ String propertyKey = "test-key";
+ String propertyValue = "session-value";
+
+ // Insert data to have rows to delete
+ sql(
+ "INSERT INTO %s VALUES (1, 'a', DATE '2021-01-01', TIMESTAMP
'2021-01-01 00:00:00'), "
+ + "(2, 'b', DATE '2021-01-01', TIMESTAMP '2021-01-01 00:00:00')",
+ tableName);
+
+ withSQLConf(
+ ImmutableMap.of("spark.sql.iceberg.snapshot-property." + propertyKey,
propertyValue),
+ () -> {
+ // Row-level delete produces overwrite snapshot
+ sql("DELETE FROM %s WHERE id = 1", tableName);
+ Table table = validationCatalog.loadTable(tableIdent);
+
assertThat(table.currentSnapshot().operation()).isEqualTo("overwrite");
+
assertThat(table.currentSnapshot().summary()).containsEntry(propertyKey,
propertyValue);
+ });
+ }
+
+ @TestTemplate
+ public void testExtraSnapshotMetadataPersistedOnFileLevelDelete() {
Review Comment:
minor: I'd call it testExtraSnapshotMetadataOnMetadataOnlyDelete() (I'd
probably drop the "persisted" and we've typically referred to this delete as a
"metadata-only" delete)
--
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]