ivandasch commented on code in PR #10338:
URL: https://github.com/apache/ignite/pull/10338#discussion_r1001680917


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ExpressionFactoryImpl.java:
##########
@@ -765,16 +797,20 @@ public RangeIterableImpl(List<RangeCondition<Row>> 
ranges, Comparator<Row> compa
         }
 
         /** {@inheritDoc} */
-        @Override public int size() {
-            return ranges.size();
+        @Override public boolean multiBounds() {
+            return ranges.size() > 1;
         }
 
         /** {@inheritDoc} */
         @Override public Iterator<RangeCondition<Row>> iterator() {
             ranges.forEach(b -> ((RangeConditionImpl)b).clearCache());
 
-            if (ranges.size() == 1)
-                return ranges.iterator();
+            if (ranges.size() == 1) {
+                if (((RangeConditionImpl)ranges.get(0)).skip())

Review Comment:
   Ok, make sense. But interface is also our own. Casting looks a little bit 
ugly.



##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/IgniteSqlFunctions.java:
##########
@@ -154,6 +154,27 @@ public static String toString(ByteString b) {
         return b == null ? null : new String(b.getBytes(), 
Commons.typeFactory().getDefaultCharset());
     }
 
+    /** LEAST2. */
+    public static Object least2(Object arg0, Object arg1) {
+        return leastOrGreatest(true, arg0, arg1);
+    }
+
+    /** GREATEST2. */
+    public static Object greatest2(Object arg0, Object arg1) {
+        return leastOrGreatest(false, arg0, arg1);
+    }
+
+    /** */
+    private static Object leastOrGreatest(boolean least, Object arg0, Object 
arg1) {
+        if (arg0 == null || arg1 == null)
+            return null;
+
+        if (((Comparable<Object>)arg0).compareTo(arg1) < 0)

Review Comment:
   Let's make and assertion here?



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