[
https://issues.apache.org/jira/browse/CALCITE-6438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855254#comment-17855254
]
Caican Cai commented on CALCITE-6438:
-------------------------------------
I noticed CoreRules.FILTER_REDUCE_EXPRESSIONS, I will close this jira
> Add optimization to returns empty when the filter operator is a false instance
> ------------------------------------------------------------------------------
>
> Key: CALCITE-6438
> URL: https://issues.apache.org/jira/browse/CALCITE-6438
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Affects Versions: 1.37.0
> Reporter: Caican Cai
> Assignee: Caican Cai
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.38.0
>
>
> {code:java}
> select * from emp where false{code}
> The current logical plan in calcite is
> {code:java}
> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4],
> SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
> LogicalFilter(condition=[false])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
> It can be optimized to
> {code:java}
> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4],
> SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
> LogicalValues(tuples=[[]]) {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)