Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
When generating code for a function call, take the inferred operand type into account. If we don't do this, the Java code we generate for CONCAT(CAST(NULL AS ANY), 'x') does not compile, because the first parameter is of type Object; it needs to be String (based on the inferred operand type of VARCHAR).
We achieve this by using SqlOperator.operandTypeInference at validate time, storing the list of inferred operand types for the call, then using that list (if available) during code generation.
Attachments
Issue Links
- causes
-
CALCITE-6012 CAST($t4):JavaType(class java.lang.Object) NOT NULL causes NPE since 1.27
- Open
- relates to
-
FLINK-16203 Support JSON_OBJECT
- Closed