my7ym commented on a change in pull request #1152: [CALCITE-2962]
RelStructuredTypeFlattener generates wrong types for n…
URL: https://github.com/apache/calcite/pull/1152#discussion_r275497904
##########
File path:
core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml
##########
@@ -867,6 +867,17 @@ LogicalProject(ZIP=[$4])
LogicalFilter(condition=[=($3, 'abc':VARCHAR(20))])
LogicalProject(EMPNO=[$0], STREET=[$1.STREET], CITY=[$1.CITY],
ZIP=[$1.ZIP], STATE=[$1.STATE], STREET5=[$2.STREET], CITY6=[$2.CITY],
ZIP7=[$2.ZIP], STATE8=[$2.STATE])
LogicalTableScan(table=[[CATALOG, SALES, EMP_ADDRESS]])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testSelectNestedColumnType">
+ <Resource name="plan">
+ <![CDATA[
+LogicalProject(COORD=[$0])
Review comment:
@zabetak Got your point.
The root actually got expanded like:
```
LogicalProject(COORD=[$4], COORD1=[$5], COORD2=[$6])
LogicalFilter(condition=[=($4, 1)])
LogicalProject(CONTACTNO=[$0], FNAME=[$1], LNAME=[$2], EMAIL=[$3],
X=[$4.X], Y=[$4.Y], unit=[$4.unit], M=[$5.M], A=[$5.SUB.A], B=[$5.SUB.B])
LogicalTableScan(table=[[CATALOG, CUSTOMER, CONTACT_PEEK]])
```
But the RelRoot.project messed it up and add an extra:
```
LogicalProject(COORD=[$0])
```
on top of the real root :(
And I like the original test case better because it's the minimum one which
could test this failure.
But I think your point also makes sense. So I managed to make up a test to
cover this issue. (And this test case is extremely similar to my project)
Let me know what you think man.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services