[
https://issues.apache.org/jira/browse/CALCITE-7775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18114614#comment-18114614
]
Mihai Budiu commented on CALCITE-7775:
--------------------------------------
Calcite is statically typed. I think this behavior is the expected one.
ANY stands for a "type I could not yet infer", something that would be an
unbound type variable in other implementations.
If we want to support a true ANYDATA type, it will have to be done
differently; VARIANT is probably the Calcite equivalent.
> UNNEST of a column of type ANY cannot be implemented
> ----------------------------------------------------
>
> Key: CALCITE-7775
> URL: https://issues.apache.org/jira/browse/CALCITE-7775
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.42.0
> Reporter: Jerome Isaac Haltom
> Priority: Minor
>
> UNNEST of a column declared ANY validates and plans, and then fails when the
> plan is implemented.
> Given a table {{s.docs}} with columns {{ID}} INTEGER and {{TAGS}} ANY:
> {code:sql}
> select "D"."ID", "T"."X"
> from "s"."docs" as "D", UNNEST("D"."TAGS") as "T"("X")
> {code}
> {noformat}
> java.lang.IllegalStateException: Unable to implement
> EnumerableCalc(expr#0..2=[{inputs}], ID=[$t0], X=[$t2])
> suppressed: java.lang.NullPointerException: componentType is null for ANY
> at
> org.apache.calcite.sql.type.NonNullableAccessors.getComponentTypeOrThrow(NonNullableAccessors.java:52)
> at
> org.apache.calcite.adapter.enumerable.EnumerableUncollect.implement(EnumerableUncollect.java:139)
> {noformat}
> Same failure for {{LEFT JOIN UNNEST(...) ON TRUE}} and for {{WITH
> ORDINALITY}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)