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



##########
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:
       If we just select from a function using `select * from func`, i think 
there is no need to translate into a `LoggicalCorrelate `, because usually a 
`LoggicalCorrelate` would be decorrelated into a `Join`, can we elaborate the 
`LogicalTableFunctionScan` inputs to specify the input table and function's 
argument as an `input ref` ?




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