[ https://issues.apache.org/jira/browse/CALCITE-2391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529233#comment-16529233 ]
Volodymyr Vysotskyi edited comment on CALCITE-2391 at 7/1/18 9:30 PM: ---------------------------------------------------------------------- Yes, it appeared recently (after 1.16 release). I was trying to see the impact of updating Calcite for Drill and found this issue. was (Author: vvysotskyi): Yes, it appeared recently. I was trying to see the impact of updating Calcite for Drill and found this issue. > Query with aggregation of UNNEST column fails with ClassCastException > --------------------------------------------------------------------- > > Key: CALCITE-2391 > URL: https://issues.apache.org/jira/browse/CALCITE-2391 > Project: Calcite > Issue Type: Bug > Reporter: Volodymyr Vysotskyi > Assignee: Julian Hyde > Priority: Major > > This test: > {code:java} > @Test public void testAggUnnestColumn() { > CalciteAssert.hr() > .query("select count(d.\"name\") as c\n" > + "from \"hr\".\"depts\" as d,\n" > + " UNNEST(d.\"employees\") as e") > .returnsUnordered( > "C=3"); > } > {code} > added to {{JdbcTest}} class fails with {{ClassCastException}} > {noformat} > Caused by: java.lang.ClassCastException: > org.apache.calcite.sql.validate.AggregatingSelectScope cannot be cast to > org.apache.calcite.sql.validate.ListScope > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.lookupExp(SqlToRelConverter.java:4293) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:3614) > at > org.apache.calcite.sql2rel.SqlToRelConverter.access$2300(SqlToRelConverter.java:213) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4692) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3990) > at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:344) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4554) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2090) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:1957) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2033) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:642) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:623) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3058) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:559) > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:264) > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:230) > at > org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:783) > at > org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:642) > at > org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:612) > at > org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:232) > at > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:609) > at > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675) > at > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156) > ... 28 more > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)