Hello,

I am trying to use Calcite to parse and transform Hive SQL queries, however
I can't seem to be able to convert the physical plan back to SQL using
*RelToSqlConverter* when the table has a nested struct, I get the following
exception:

*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*

I have been able to isolate the issue in a test case that is accessible at
https://github.com/BenoitHanotte/calcite/commit/fd879310efab2858e33e06a9d666c106763e36db
In this example, the table is a simple table with the following schema *{a:
{b: INTEGER} }* . A simple *SELECT ** queryfails with the above exception.

I am missing a step in my processing or doing something that is not
expected?

Thanks a lot!

Benoit

Reply via email to