rionmonster commented on code in PR #28437:
URL: https://github.com/apache/flink/pull/28437#discussion_r4789306395


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/TypeInferenceUtil.java:
##########
@@ -155,11 +158,63 @@ private static CallContext castArgumentsInternal(
                                 "Invalid argument type at position %d. Data 
type %s expected but %s passed.",
                                 pos, expectedType, actualType));
             }
+
+            // Beyond type-level castability, a constant DECIMAL literal must 
also fit the
+            // expected type on the value level.
+            if (throwOnInferInputFailure) {
+                validateDecimalLiteralFitsExpectedType(callContext, pos, 
expectedType);

Review Comment:
   Great catch on this one. I've implemented it and the check is now opt-in and 
doesn't touch `castArguments` at all). I've verified it to confirm that the 
literal is generated in in the plan, where it would previously fail during 
restoration.



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