aokolnychyi commented on code in PR #10123:
URL: https://github.com/apache/iceberg/pull/10123#discussion_r1566275123


##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestDelete.java:
##########
@@ -501,6 +503,38 @@ public void testDeleteNonExistingRecords() {
         sql("SELECT * FROM %s ORDER BY id ASC NULLS LAST", selectTarget()));
   }
 
+  @TestTemplate
+  public void deleteSingleRecordProducesDeleteOperation() {
+    sql(
+        "CREATE TABLE %s USING iceberg AS SELECT 'personA' as name UNION 
SELECT 'personB' as name UNION SELECT 'personC' as name",
+        tableName);
+    initTable();
+
+    sql("DELETE FROM %s WHERE name = 'personA'", tableName);
+
+    Table table = validationCatalog.loadTable(tableIdent);
+    assertThat(table.snapshots()).hasSize(2);
+
+    Snapshot currentSnapshot = table.currentSnapshot();
+
+    if 
(Boolean.parseBoolean(spark.conf().get(SQLConf.ADAPTIVE_EXECUTION_ENABLED().key())))
 {

Review Comment:
   I recommend using `append` methods in `SparkRowLevelOperationsTestBase` to 
make sure the 3 records are added as a single file (those that accept json). 
Otherwise, you have to check for AQE and this logic is very fragile overall. 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to