thomasrebele commented on code in PR #4505:
URL: https://github.com/apache/calcite/pull/4505#discussion_r2486496978


##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -415,17 +415,22 @@ private RexNode simplifyGenericNode(RexCall e) {
    */
   private static int findLiteralIndex(List<RexNode> operands, BigDecimal 
value) {
     for (int i = 0; i < operands.size(); i++) {
-      if (operands.get(i).isA(SqlKind.LITERAL)) {
-        Comparable comparable = ((RexLiteral) operands.get(i)).getValue();
-        if (comparable instanceof BigDecimal
-            && value.compareTo((BigDecimal) comparable) == 0) {
-          return i;
-        }
+      if (checkLiteralValue(operands.get(i), value)) {
+        return i;
       }
     }
     return -1;
   }
 
+  /** Check whether the operand is a literal of the specified value. */

Review Comment:
   I've changed the javadoc to mention BigDecimal.



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