[ 
https://issues.apache.org/jira/browse/CALCITE-4065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Slim Bouguerra updated CALCITE-4065:
------------------------------------
    Attachment: test_cases_CALCITE-4065.patch

> Projecting a nested Row fails with 
> org.apache.calcite.util.Util.needToImplement
> -------------------------------------------------------------------------------
>
>                 Key: CALCITE-4065
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4065
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.22.0
>            Reporter: Slim Bouguerra
>            Priority: Major
>         Attachments: test_cases_CALCITE-4065.patch
>
>
> Calcite Row operator does not support the projection of a Nested row.
> Take this example where the goal is to Select the inner row 
> {code:java}
>  ROW(2) {code}
> Full query is
> {code:java}
> select row(1,row(2)).\"EXPR$1\" from emp
> {code}
> Query fails to plan with the exception listed below
> {code:java}
> class org.apache.calcite.rex.RexFieldAccess: ROW(1, ROW(2)).EXPR$1
> java.lang.UnsupportedOperationException: class 
> org.apache.calcite.rex.RexFieldAccess: ROW(1, ROW(2)).EXPR$1
>       at org.apache.calcite.util.Util.needToImplement(Util.java:967)
>       at 
> org.apache.calcite.sql2rel.RelStructuredTypeFlattener.flattenProjection(RelStructuredTypeFlattener.java:699)
>       at 
> org.apache.calcite.sql2rel.RelStructuredTypeFlattener.flattenProjections(RelStructuredTypeFlattener.java:601)
>       at 
> org.apache.calcite.sql2rel.RelStructuredTypeFlattener.rewriteRel(RelStructuredTypeFlattener.java:521)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.apache.calcite.util.ReflectUtil.invokeVisitorInternal(ReflectUtil.java:257)
>       at 
> org.apache.calcite.util.ReflectUtil.invokeVisitor(ReflectUtil.java:214)
>       at 
> org.apache.calcite.util.ReflectUtil$1.invokeVisitor(ReflectUtil.java:464)
>       at 
> org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRelVisitor.visit(RelStructuredTypeFlattener.java:831)
>       at 
> org.apache.calcite.sql2rel.RelStructuredTypeFlattener.rewrite(RelStructuredTypeFlattener.java:198)
>       at 
> org.apache.calcite.sql2rel.SqlToRelConverter.flattenTypes(SqlToRelConverter.java:473)
>       at 
> org.apache.calcite.test.SqlToRelTestBase$TesterImpl.convertSqlToRel(SqlToRelTestBase.java:634)
>       at 
> org.apache.calcite.test.SqlToRelTestBase$TesterImpl.assertConvertsTo(SqlToRelTestBase.java:749)
>       at 
> org.apache.calcite.test.SqlToRelConverterTest$Sql.convertsTo(SqlToRelConverterTest.java:3864)
>       at 
> org.apache.calcite.test.SqlToRelConverterTest$Sql.ok(SqlToRelConverterTest.java:3856)
>       at 
> org.apache.calcite.test.SqlToRelConverterTest.testDotLiteralAfterRow(SqlToRelConverterTest.java:98)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
>       at 
> org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
>       
> // org.apache.calcite.test.SqlToRelConverterTest#testDotLiteralAfterRow
> {code}
>  



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

Reply via email to