Vladsz83 commented on code in PR #11525:
URL: https://github.com/apache/ignite/pull/11525#discussion_r1769606486


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ExpressionFactoryImpl.java:
##########
@@ -237,7 +239,8 @@ else if (c2 != HIGHEST_VALUE)
                 }
 
                 // If compared rows contain NULLs, they shouldn't be treated 
as equals, since NULL <> NULL in SQL.
-                return hasNulls ? 1 : 0;
+                // Expect for cases with IS DISTINCT / IS NOT DISTINCT.
+                return hasNulls ? nullComparison : 0;

Review Comment:
   Nulls comparison must be the same to the `right`. It is checked above:
   
   ```
           // Check that collations is correct.
           for (int i = 0; i < left.size(); i++) {
               if (left.get(i).nullDirection.nullComparison != 
right.get(i).nullDirection.nullComparison)
                   throw new IllegalArgumentException("Can't be compared: 
left=" + left.get(i) + ", right=" + right.get(i));
   
               if (left.get(i).direction != right.get(i).direction)
                   throw new IllegalArgumentException("Can't be compared: 
left=" + left.get(i) + ", right=" + right.get(i));
           }
   ```
   
   While returning `1` seems to work, taking a real comparison value covers 
theoretical common case. Let's keep it. WDYT?



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to