chunweilei commented on a change in pull request #1256: [CALCITE-3101] Don't 
push non-equi join conditions into Project below Join
URL: https://github.com/apache/calcite/pull/1256#discussion_r310855089
 
 

 ##########
 File path: core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
 ##########
 @@ -466,6 +466,28 @@ LogicalProject(EXPR$0=[1])
     LogicalJoin(condition=[true], joinType=[inner])
       LogicalTableScan(table=[[CATALOG, SALES, EMP]])
       LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+]]>
+        </Resource>
+    </TestCase>
+    <TestCase name="testNotPushExpression">
+        <Resource name="sql">
+            <![CDATA[select 1 from emp inner join dept
+            on emp.deptno=dept.deptno and emp.ename is not null]]>
+        </Resource>
+        <Resource name="planBefore">
+            <![CDATA[
+LogicalProject(EXPR$0=[1])
+  LogicalJoin(condition=[AND(=($7, $9), IS NOT NULL($1))], joinType=[inner])
+    LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+    LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 
 Review comment:
   What is the advantage of your proposal? Sometimes pushing down the non-equi 
join conditions might have benefits. For example, execution count of non-equi 
condistions may be reduced from rowcount(a)*rowcount(b) to rowcount(a). 

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


With regards,
Apache Git Services

Reply via email to