[
https://issues.apache.org/jira/browse/CALCITE-2417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16556006#comment-16556006
]
Michael Mior commented on CALCITE-2417:
---------------------------------------
Fixed in
[3c40d86|https://github.com/apache/calcite/commit/3c40d866a43f8a74f35a6b31fadf145c4d1d9f94].
> Select * on table with nested struct throws ClassCastException: RexInputRef
> cannot be cast to RexCorrelVariable
> ---------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-2417
> URL: https://issues.apache.org/jira/browse/CALCITE-2417
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.16.0, next
> Reporter: Benoit Hanotte
> Assignee: Julian Hyde
> Priority: Major
> Fix For: 1.18.0
>
>
> Trying to convert the physical plan of a _select *_ query on a table with a
> nested struct throws ClassCastException as RexInputRef cannot be cast to
> RexCorrelVariable:
>
> _Caused by: java.lang.ClassCastException: org.apache.calcite.rex.RexInputRef
> cannot be cast to org.apache.calcite.rex.RexCorrelVariable_
> _at
> org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:446)_
> _at
> org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:182)_
> _... 38 more_
>
> You may find a test case to reproduce the issue at
> [https://github.com/BenoitHanotte/calcite/commit/fd879310efab2858e33e06a9d666c106763e36db]
>
> This is likely due to the cast to RexCorrelVariable not being done on the
> referenced expression of RexInputRef accessible through
> RexFieldAccess.getReferenceExpr()
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)