aokolnychyi commented on a change in pull request #3763:
URL: https://github.com/apache/iceberg/pull/3763#discussion_r773291256
##########
File path:
spark/v3.2/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestDelete.java
##########
@@ -749,6 +772,46 @@ public void testDeleteRefreshesRelationCache() throws
NoSuchTableException {
spark.sql("UNCACHE TABLE tmp");
}
+ @Test
+ public void testDeleteWithMultipleSpecs() {
+ createAndInitTable("id INT, dep STRING, category STRING");
+
+ // write an unpartitioned file
+ append(tableName, "{ \"id\": 1, \"dep\": \"hr\", \"category\": \"c1\"}");
+
+ // write a file partitioned by dep
+ sql("ALTER TABLE %s ADD PARTITION FIELD dep", tableName);
+ append(tableName,
+ "{ \"id\": 1, \"dep\": \"hr\", \"category\": \"c1\" }\n" +
+ "{ \"id\": 2, \"dep\": \"hr\", \"category\": \"c1\" }");
+
+ // write a file partitioned by dep and category
+ sql("ALTER TABLE %s ADD PARTITION FIELD category", tableName);
+ append(tableName, "{ \"id\": 1, \"dep\": \"hr\", \"category\": \"c1\"}");
Review comment:
The idea of this test is to create files with `id = 1` in a number of
specs and then issue a single delete that would remove all matching records and
write delete files that belong to multiple specs. That's why multiple files
contain the same record.
--
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]