vldpyatkov commented on code in PR #5393:
URL: https://github.com/apache/calcite/pull/5393#discussion_r4494399023


##########
core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java:
##########
@@ -1004,6 +1004,21 @@ private void checkCeil(int x, int y, int result) {
     assertThat(Utilities.compare(empty, empty), is(0));
   }
 
+  /** Composite null keys compare equally for sorting, but must not match in a 
merge join. */
+  @Test void testCompareCompositeNullKeys() {
+    final Object key = new Object[]{1, null};
+    assertThat(Utilities.compareCompositeNullsFirst(null, null), is(0));
+    assertThat(Utilities.compareCompositeNullsLast(null, null), is(0));
+    assertThat(Utilities.compareCompositeNullsLastForMergeJoin(null, key), 
is(1));
+    assertThat(Utilities.compareCompositeNullsLastForMergeJoin(key, null), 
is(-1));
+    assertThat(Utilities.compareCompositeNullsLastForMergeJoin(key, new 
Object[]{1, null}), is(0));
+    final RuntimeException exception =

Review Comment:
   Comments added.



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

Reply via email to