You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Caican Cai (Jira)" <ji...@apache.org> on 2026/05/15 14:29:00 UTC

[jira] [Updated] (CALCITE-7464) Refactor type coercion in array/map functions to avoid mutating operands as side effects

     [ https://issues.apache.org/jira/browse/CALCITE-7464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Caican Cai updated CALCITE-7464:
--------------------------------
    Fix Version/s:     (was: 1.42.0)

> 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
>            Priority: Major
>              Labels: pull-request-available
>
> 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)