chunweilei commented on a change in pull request #1917: [CALCITE-3910] Enhance 
ProjectJoinTransposeRule to support SemiJoin and AntiJoin
URL: https://github.com/apache/calcite/pull/1917#discussion_r409268046
 
 

 ##########
 File path: core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
 ##########
 @@ -7350,6 +7350,44 @@ LogicalProject(NAME=[$1])
               LogicalFilter(condition=[>($0, 10)])
                 LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
     LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+]]>
+        </Resource>
+    </TestCase>
+    <TestCase name="testSemiJoinProjectTranspose">
+        <Resource name="sql">
+            <![CDATA[select a.name from dept a
+where a.deptno in (select b.deptno * 2 from dept);
+]]>
+        </Resource>
+        <Resource name="planAfter">
+            <![CDATA[
+LogicalProject(DNAME=[$1])
+  LogicalJoin(condition=[=($0, $2)], joinType=[semi])
+    LogicalProject(DEPTNO=[$0], DNAME=[$1])
+      LogicalTableScan(table=[[scott, DEPT]])
+    LogicalProject($f0=[$0])
+      LogicalAggregate(group=[{0}])
+        LogicalProject($f0=[*(2, $0)])
+          LogicalTableScan(table=[[scott, DEPT]])
 
 Review comment:
   Where is the `planBefore`?

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


With regards,
Apache Git Services

Reply via email to