karuppayya commented on code in PR #11045:
URL: https://github.com/apache/iceberg/pull/11045#discussion_r1739341390


##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestCreateChangelogViewProcedure.java:
##########
@@ -242,6 +249,34 @@ public void testUpdateWithIdentifierField() {
         sql("select * from %s order by _change_ordinal, id, data", viewName));
   }
 
+  @TestTemplate
+  public void testUpdateWithInComparableType() {
+    createTableWithIncomparableType();
+
+    sql("INSERT INTO %s VALUES (2, Map('b','b'), 12)", tableName);
+    Table table = validationCatalog.loadTable(tableIdent);
+    Snapshot snap1 = table.currentSnapshot();
+
+    sql("INSERT OVERWRITE %s VALUES (3, Map('c','c'), 13), (2, Map('d','d'), 
12)", tableName);
+    table.refresh();
+    Snapshot snap2 = table.currentSnapshot();
+
+    assertThat(table.sortOrder()).isNotNull();
+
+    List<Object[]> returns =
+        sql("CALL %s.system.create_changelog_view(table => '%s')", 
catalogName, tableName);
+
+    String viewName = (String) returns.get(0)[0];
+    assertEquals(
+        "Rows should match",
+        ImmutableList.of(
+            row(2, Collections.singletonMap("b", "b"), 12, INSERT, 0, 
snap1.snapshotId()),
+            row(2, Collections.singletonMap("b", "b"), 12, DELETE, 1, 
snap2.snapshotId()),
+            row(2, Collections.singletonMap("d", "d"), 12, INSERT, 1, 
snap2.snapshotId()),
+            row(3, Collections.singletonMap("c", "c"), 13, INSERT, 1, 
snap2.snapshotId())),
+        sql("select * from %s order by _change_ordinal, id", viewName));

Review Comment:
   yeah, 
   looked like a standalone sql on first look :) . 



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