You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2021/10/09 00:33:00 UTC

[jira] [Created] (CALCITE-4842) Nested row type fails with unsupported type Record2_2

Sergey Nuyanzin created CALCITE-4842:
----------------------------------------

             Summary: Nested row type fails with unsupported type Record2_2
                 Key: CALCITE-4842
                 URL: https://issues.apache.org/jira/browse/CALCITE-4842
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.27.0
            Reporter: Sergey Nuyanzin


Queries with nested rows fail with the exception below
for instance these queries could be used to reproduce
{code:sql}
select row(row(1));
select row(row(1, 2), row(3, 4));
{code}
At the same time
{code:sql}
select array[row(row(1))];
select array[row(row(1, 2), row(3, 4))];
{code}
are ok
{noformat}
java.sql.SQLException: Error while executing SQL "select row(row(1))": unsupported type Record1_0
        at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
        at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
        at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163)
        at org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:217)
        at sqlline.Commands.executeSingleQuery(Commands.java:1130)
        at sqlline.Commands.execute(Commands.java:1079)
        at sqlline.Commands.sql(Commands.java:1033)
        at sqlline.SqlLine.dispatch(SqlLine.java:822)
        at sqlline.SqlLine.begin(SqlLine.java:596)
        at sqlline.SqlLine.start(SqlLine.java:269)
        at sqlline.SqlLine.main(SqlLine.java:208)
Caused by: java.lang.RuntimeException: unsupported type Record1_0
	at org.apache.calcite.linq4j.tree.Types.toClass(Types.java:152)
	at org.apache.calcite.linq4j.tree.Types.toClassArray(Types.java:166)
	at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:449)
	at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.classDecl(EnumerableRelImplementor.java:292)
	at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.access$000(EnumerableRelImplementor.java:79)
	at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor$TypeRegistrar.register(EnumerableRelImplementor.java:562)
	at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor$TypeRegistrar.register(EnumerableRelImplementor.java:566)
	at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor$TypeRegistrar.go(EnumerableRelImplementor.java:576)
	at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:146)
	at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:113)
	at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1130)
	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:318)
	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:215)
	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647)
	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513)
	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483)
	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:249)
	at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
	at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675)
	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
	... 8 more
{noformat}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)