asolimando commented on code in PR #4529:
URL: https://github.com/apache/calcite/pull/4529#discussion_r2332540175


##########
core/src/main/java/org/apache/calcite/rex/RexLiteral.java:
##########
@@ -1275,6 +1275,11 @@ public static Number numberValue(RexNode node) {
    * never null. */
   public static int intValue(RexNode node) {
     final Number number = numberValue(node);
+    long longValue = number.longValue();
+    if (longValue > Integer.MAX_VALUE || longValue < Integer.MIN_VALUE) {
+      throw new ArithmeticException(
+          "integer overflow: Value " + longValue + " out of range for INT");

Review Comment:
   Nit: ```suggestion
             "Integer overflow: " + longValue + " is out of range for INT");
   ```?



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