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 2021/01/06 02:25:29 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #2315: [CALCITE-4456] Allows all the value expressions for explicit row valu…

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



##########
File path: core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml
##########
@@ -1061,6 +1061,23 @@ LogicalProject(EXPR$0=[ROW(ROW(1, 2), ROW(3, 4, 5)).EXPR$1.EXPR$2])
             <![CDATA[
 LogicalProject(EXPR$0=[ROW(1, 2).EXPR$1])
   LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+]]>
+        </Resource>
+    </TestCase>
+    <TestCase name="testRowValueConstructorWithSubquery">
+        <Resource name="sql">
+            <![CDATA[select ROW((select deptno
+from dept
+where dept.deptno = emp.deptno), emp.ename)
+from emp]]>
+        </Resource>
+        <Resource name="plan">
+            <![CDATA[
+LogicalProject(EXPR$0=[ROW($9, $1)])
+  LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8], DEPTNO9=[$9])
+    LogicalJoin(condition=[=($9, $7)], joinType=[left])

Review comment:
       Because it may outputs NULLs

##########
File path: core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml
##########
@@ -1061,6 +1061,23 @@ LogicalProject(EXPR$0=[ROW(ROW(1, 2), ROW(3, 4, 5)).EXPR$1.EXPR$2])
             <![CDATA[
 LogicalProject(EXPR$0=[ROW(1, 2).EXPR$1])
   LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+]]>
+        </Resource>
+    </TestCase>
+    <TestCase name="testRowValueConstructorWithSubquery">
+        <Resource name="sql">
+            <![CDATA[select ROW((select deptno
+from dept
+where dept.deptno = emp.deptno), emp.ename)
+from emp]]>
+        </Resource>
+        <Resource name="plan">
+            <![CDATA[
+LogicalProject(EXPR$0=[ROW($9, $1)])
+  LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8], DEPTNO9=[$9])
+    LogicalJoin(condition=[=($9, $7)], joinType=[left])

Review comment:
       Because it may output NULLs




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