Jerome Isaac Haltom created CALCITE-7775:
--------------------------------------------

             Summary: 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
            Reporter: Jerome Isaac Haltom


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)

Reply via email to