rdblue commented on code in PR #7050:
URL: https://github.com/apache/iceberg/pull/7050#discussion_r1133141321


##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestDelete.java:
##########
@@ -1066,6 +1068,50 @@ public void testDeleteWithMultipleSpecs() {
         sql("SELECT * FROM %s ORDER BY id", selectTarget()));
   }
 
+  @Test
+  public void testDeleteToWAPBranch() throws NoSuchTableException {
+    Assume.assumeTrue("WAP branch only works for table identifier without 
branch", branch == null);
+
+    createAndInitPartitionedTable();
+    sql(
+        "ALTER TABLE %s SET TBLPROPERTIES ('%s' = 'true')",
+        tableName, TableProperties.WRITE_AUDIT_PUBLISH_ENABLED);
+    append(new Employee(0, "hr"), new Employee(1, "hr"), new Employee(2, 
"hr"));
+
+    try {
+      spark.conf().set(SparkSessionProperties.WAP_BRANCH, "wap");
+      sql("DELETE FROM %s t WHERE id=0", tableName);
+      Assert.assertEquals(
+          "Should have expected num of rows", 2L, spark.table(tableName + 
".branch_wap").count());

Review Comment:
   Is this branch read necessary or is it the default in WAP? I think it needs 
to be the default so that dynamic pruning works. That said, it does make sense 
to allow reading specific branches, and to read a specific branch here to 
validate behavior.
   
   Should we also validate that `tableName + ".branch_main"` has not been 
modified?



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