Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.27.0
-
None
Description
Queries with nested rows fail with the exception below
for instance these queries could be used to reproduce
select row(row(1)); select row(row(1, 2), row(3, 4));
At the same time
select array[row(row(1))]; select array[row(row(1, 2), row(3, 4))];
are ok
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
Attachments
Issue Links
- relates to
-
CALCITE-5701 Add NAMED_STRUCT function (enabled in Spark library)
- Open
- links to