danny0405 commented on a change in pull request #2092:
URL: https://github.com/apache/calcite/pull/2092#discussion_r464764786



##########
File path: 
core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml
##########
@@ -323,7 +323,121 @@ LogicalProject(DEPTNO=[$0], NAME=[$1], I=[$2])
 ]]>
         </Resource>
     </TestCase>
-    <TestCase name="testSnapshotOnTemporalTable1">
+    <TestCase name="testTableFunctionInSelect">
+        <Resource name="sql">
+            <![CDATA[select * from (select table_func(dept.deptno) as (f0, f1) 
from dept)]]>
+        </Resource>
+        <Resource name="plan">
+            <![CDATA[
+LogicalProject(F0=[$2], F1=[$3])
+  LogicalCorrelate(correlation=[$cor0], joinType=[inner], 
requiredColumns=[{0}])
+    LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+    LogicalTableFunctionScan(invocation=[TABLE_FUNC($cor0.DEPTNO)], 
rowType=[RecordType(BIGINT f0, VARCHAR f1)], elementType=[class 
[Ljava.lang.Object;])

Review comment:
       The plan is not correct, there is no need to translate as a 
`LogicalCorrelate`, the `LogicalTableFunctionScan` inputs need to be set 
correctly.




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


Reply via email to