Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.16.0
Description
I have found the case, when Filter operator is not necessary since filter condition is always true, but that is not detected by current version of Calcite.
select SAL from EMPNULLABLES_20 where SAL IS NOT NULL OR SAL is null
LogicalProject(SAL=[$5]) LogicalFilter(condition=[OR(IS NOT NULL($5), IS NULL($5))]) LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6], SLACKER=[$8]) LogicalFilter(condition=[AND(=($7, 20), >($5, 1000))]) LogicalTableScan(table=[[CATALOG, SALES, EMPNULLABLES]])
But filter condition OR(IS NOT NULL($5), IS NULL($5)) can be proved to be always true.
I have tried ReduceExpressionsRule, but it doesn't give effect.
Attachments
Issue Links
- is related to
-
CALCITE-2247 Simplify AND and OR conditions using predicates
-
- Closed
-
- relates to
-
CALCITE-2438 RexCall#isAlwaysTrue return incorrect result
-
- Closed
-
-
CALCITE-1995 Remove predicates from Filter if they can be proved to be always true or false
-
- Closed
-
-
DRILL-6173 Support transitive closure during filter push down and partition pruning
-
- Resolved
-
- links to