You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/08/13 06:34:57 UTC

[GitHub] [calcite] julianhyde commented on a change in pull request #2092: [CALCITE-1581] Support UDTF like Hive

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



##########
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:
       I think `LoggicalCorrelate` is the right thing. This is a function that RETURNS a table on each invocation but its arguments are scalars, and the scalars are correlating variables.




----------------------------------------------------------------
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:
users@infra.apache.org