amogh-jahagirdar commented on code in PR #9556:
URL: https://github.com/apache/iceberg/pull/9556#discussion_r1465683526


##########
spark/v3.4/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMerge.java:
##########
@@ -2144,6 +2144,26 @@ public void testMergeWithTableWithNonNullableColumn() {
         sql("SELECT * FROM %s ORDER BY id", selectTarget()));
   }
 
+  @Test
+  public void testMergeIntoNullUnmatchedValues() {
+    createAndInitTable(
+        "id INT, ts TIMESTAMP",
+        "{ \"id\": 1, \"ts\": \"2000-01-01 00:00:00\" }\n" + "{ \"id\": 6, 
\"ts\": null }");
+
+    createOrReplaceView(
+        "source",
+        "id INT NOT NULL, ts TIMESTAMP",
+        "{ \"id\": 1, \"ts\": \"2000-01-01 00:00:00\" }\n");
+    sql(
+        "MERGE INTO %s t USING source s "
+            + "ON t.id == s.id "
+            + "WHEN MATCHED THEN "
+            + "  UPDATE SET id=123, ts=current_timestamp()",
+        commitTarget());
+
+    sql("SELECT * FROM %s", commitTarget());

Review Comment:
   i'll need to add an assertion but did verify this outputs the right values. 
I'll also add more tests once CI verifies everything else still passes.



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