Aitozi opened a new pull request, #3035:
URL: https://github.com/apache/calcite/pull/3035

   …elate
   
   Before fix the sql in test will be optimize to:
   
   ```
   LogicalProject(ENAME=[$0], EMPNO=[$1], EMPNO_R=[$3], TYPE=[CASE(=($2, 
'bounded'), 1, 2)])
     LogicalCorrelate(correlation=[$cor0], joinType=[inner], 
requiredColumns=[{1}])
       LogicalProject(ENAME=[$1], EMPNO=[$0], __SOURCE__TYPE__=['bounded'])
         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
       LogicalTableFunctionScan(invocation=[RAMP($cor0.EMPNO)], 
rowType=[RecordType(INTEGER I)])
   ```
   
   Now, the constant condition can be reduced:
   
   ```
   LogicalProject(ENAME=[$0], EMPNO=[$1], EMPNO_R=[$3], TYPE=[1])
     LogicalCorrelate(correlation=[$cor0], joinType=[inner], 
requiredColumns=[{1}])
       LogicalProject(ENAME=[$1], EMPNO=[$0], __SOURCE__TYPE__=['bounded'])
         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
       LogicalTableFunctionScan(invocation=[RAMP($cor0.EMPNO)], 
rowType=[RecordType(INTEGER I)])
   ```


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

To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to