[
https://issues.apache.org/jira/browse/CALCITE-6743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907710#comment-17907710
]
Mihai Budiu commented on CALCITE-6743:
--------------------------------------
I wasn't planning to work on this. I am not sure 100% compatibility with Spark
can be achieved easily.
> Type inference for ARRAY_INSERT function produces an inconsistent result
> ------------------------------------------------------------------------
>
> Key: CALCITE-6743
> URL: https://issues.apache.org/jira/browse/CALCITE-6743
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.38.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> Consider this test:
> {code}
> select array_insert(array(1, 2, 3), 3, cast(4 as double))
> {code}
> The type inference for array_insert first infers a type of INTEGER ARRAY for
> the first argument of array_insert. That's correct. Then it infers a type of
> double for the last argument. That's also fine.
> Then it uses a function called adjustTypeForArrayFunction to rewrite the
> array constructor into array(1.0, 2.0, 3.0) with double arguments.
> Unfortunately the type in the typeMap for this array is never adjusted, and
> remains INTEGER ARRAY, which is incorrect.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)