kasakrisz commented on code in PR #5781:
URL: https://github.com/apache/hive/pull/5781#discussion_r2074960014


##########
iceberg/iceberg-handler/src/test/queries/positive/merge_with_null_check_on_joining_col.q:
##########
@@ -0,0 +1,24 @@
+
+create table target(a int, b int, c int) stored by iceberg 
tblproperties('format-version'='2', 'write.merge.mode'='copy-on-write');
+create table source(a int, b int, c int) stored by iceberg 
tblproperties('format-version'='2', 'write.merge.mode'='copy-on-write');
+
+-- empty plan as joining column cannot be null for matched clause
+explain cbo
+merge into target as t using source as s on t.a = s.a and t.b = s.b
+when matched and t.a is null then delete;
+
+explain cbo
+merge into target as t using source as s on t.a = s.a and t.b = s.b
+when matched and t.a is null then update set b = t.b + 10;
+--------------------------------------------------------------------
+
+ -- non empty plans for these queries
+explain cbo
+merge into target as t using source as s on t.a = s.a and t.b = s.b
+when not matched and t.a is null then insert values (1, 2, 3);
+
+explain cbo
+merge into target as t using source as s on t.a = s.a and t.b = s.b
+when matched and t.a is null then delete
+when matched then update set b = t.b + 10
+when not matched then insert values (1, 2, 3);

Review Comment:
   
https://github.com/apache/hive/blob/8222107dffb3f37310e18e8af487bcd0e8107029/iceberg/iceberg-handler/src/test/queries/positive/merge_iceberg_copy_on_write_unpartitioned.q#L26-L29



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

Reply via email to