Caican Cai created CALCITE-7464:
-----------------------------------
Summary: Refactor type coercion in array/map functions to avoid
mutating operands as side effects
Key: CALCITE-7464
URL: https://issues.apache.org/jira/browse/CALCITE-7464
Project: Calcite
Issue Type: Improvement
Affects Versions: 1.41.0
Reporter: Caican Cai
Fix For: 1.42.0
Several array and map functions currently insert explicit CAST nodes by
mutating operands (call.setOperand()) as a side effect during type checking or
return type inference. As noted by Julian Hyde and Mihai Budiu in CALCITE-6300,
this violates the "functional programming" principle — SqlOperandTypeChecker
and return type inference should be side-effect-free, and other code may be
surprised by such mutations.
This pattern has spread to multiple functions: In return type inference (via
- ARRAY_APPEND / ARRAY_PREPEND / ARRAY_INSERT
--
This message was sent by Atlassian Jira
(v8.20.10#820010)