zhangbutao commented on code in PR #4700: URL: https://github.com/apache/hive/pull/4700#discussion_r1348577916
########## iceberg/iceberg-handler/src/test/queries/positive/delete_iceberg_copy_on_write_partitioned.q: ########## @@ -0,0 +1,30 @@ +drop table if exists tbl_ice; +create external table tbl_ice(a int, b string, c int) partitioned by spec (bucket(16, a), truncate(3, b)) stored by iceberg tblproperties ('format-version'='2'); + +-- delete using simple predicates +insert into tbl_ice values (1, 'one', 50), (2, 'two', 51), (3, 'three', 52), (4, 'four', 53), (5, 'five', 54), (111, 'one', 55), (333, 'two', 56); +delete from tbl_ice where b in ('one', 'four') or a = 22; +select * from tbl_ice order by a; +-- (2, 'two', 51), (3, 'three', 52), (5, 'five', 54), (333, 'two', 56) + +-- delete using subqueries referencing the same table +insert into tbl_ice values (444, 'hola', 800), (555, 'schola', 801); +delete from tbl_ice where a in (select a from tbl_ice where a <= 5) or c in (select c from tbl_ice where c > 800); +select * from tbl_ice order by a; +-- (333, 'two', 56), (444, 'hola', 800) + +-- delete using a join subquery between the same table & another table +drop table if exists tbl_ice_other; +create external table tbl_ice_other(a int, b string) stored by iceberg; +insert into tbl_ice_other values (10, 'ten'), (333, 'hundred'); +delete from tbl_ice where a in (select t1.a from tbl_ice t1 join tbl_ice_other t2 on t1.a = t2.a); Review Comment: Good complex test! Just a nit suggestion: Should we `explain ` the delete statement? -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org