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


##########
core/src/main/java/org/apache/calcite/sql/SqlNumericLiteral.java:
##########
@@ -103,7 +103,7 @@ public boolean isExact() {
           BigDecimal bd = getValueNonNull();
           SqlTypeName result;
           // Will throw if the number cannot be represented as a long.
-          long l = bd.longValue();
+          long l = bd.longValueExact();

Review Comment:
   As per the 
[documentation](https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html#longValueExact--),
 this will throw an `ArithmeticException` in case of overflow, should we catch 
it and fallback do decimal?



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