Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.29.0
Description
For example:
x = 1 and x <> 2
In optimizer procedure, We pull up "x = 1" first, then when we encounter "x <> 2", can be simplified to "x = 1". So the result will be "x = 1"
x <> 2 and x = 1
When we pull up "x <> 2" first, it can't optimize the "x = 1". So we need SARG to optimize it again.
Because EQUALS and NOT-EQUALS operator will make the left RexNode become [CAST($t0): INTEGER NOT NULL] when the left node and right node have a least restrictive type. So we need to handle the CAST operator.
Attachments
Issue Links
- is related to
-
CALCITE-4173 Add internal SEARCH operator and Sarg literal, replacing use of IN in RexCall
- Closed
-
CALCITE-1790 Simplify CASE P1 THEN <boolean> P@ THEN <booleans> ... ELSE TRUE/FALSE
- Open
- links to