xtern commented on code in PR #6283:
URL: https://github.com/apache/ignite-3/pull/6283#discussion_r2219119254


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/RexUtils.java:
##########
@@ -924,15 +914,24 @@ private static RexNode 
expandBooleanFieldComparison(RexNode rexNode, RexBuilder
         return null;
     }
 
-    private static @Nullable RexSlot extractRefFromOperand(RexCall call, 
RelOptCluster cluster, int operandNum) {
+    private static @Nullable RexSlot extractRefFromOperand(RexCall call, int 
operandNum) {
         assert isSupportedTreeComparison(call) : "Unsupported RexNode is tree 
comparison: " + call;
 
         RexNode op = call.getOperands().get(operandNum);
+        RelDataType operandType = op.getType();
 
-        op = removeCast(op);
+        while (isLosslessCast(op)) {
+            op = ((RexCall) op).getOperands().get(0);
+        }
+
+        // We cannot compose search condition if expression requires to be 
downcasted in order to be put
+        // in bound. Downcast is not safe, and may throw `Out of range` error. 
As of now, such case
+        // must be handler by user explicitly by manually CASTing to the 
required type.

Review Comment:
   ```suggestion
           // must be handled by user explicitly by manually CASTing to the 
required type.
   ```



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