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


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -626,16 +644,15 @@ void testCastExactNumericLimits(CastType castType, 
SqlOperatorFixture f) {
 
       // Overflow test
       if (numeric == Numeric.BIGINT) {
-        // Calcite cannot even represent a literal so large, so
-        // for this query even the safe casts fail at compile-time
-        // (runtime == false).
-        f.checkFails("cast(^" + numeric.maxOverflowNumericString + "^ as 
BIGINT)",
-            LITERAL_OUT_OF_RANGE_MESSAGE, false);
-        f.checkFails("cast(^" + numeric.minOverflowNumericString + "^ as 
BIGINT)",
-            LITERAL_OUT_OF_RANGE_MESSAGE, false);
+        // Overflow for casting decimals produces a different error
+        f.checkCastFails(numeric.maxOverflowNumericString,
+            type, "Overflow", true, castType);
+        f.checkCastFails(numeric.minOverflowNumericString,
+            type, "Overflow", true, castType);
       } else {
         if (numeric != Numeric.DECIMAL5_2) {
           // This condition is for bug [CALCITE-6078], not yet fixed
+          // FIXME: decimal casts are still incorrect.

Review Comment:
   Nit: Is this comment adding anything more than the existing one?



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