Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.17.0
-
None
-
None
Description
I would like to update RexSimplify as follows:
1) Avoid multiple passes over the same expressions. Current logic calls "simplify" in multiple places, and it might cause simplification of the same tree again and again.
2) I would like to rework unknownAsFalse into support for IS TRUE. Current support for unknownAsFalse is hard to follow, and it looks like IS_TRUE(expr) allows for the same optimizations. In other words, "unknownAsFalse" would become a silent adding of IS_TRUE on top of the input expression. Then rules like OR(x, y) IS TRUE ==> x IS TRUE or y IS TRUE would push IS TRUE downstream.
3) I would like to "reorder" predicates in a defined order (e.g. rewrite 5=x ==> x=5 or (x=1 or y=2) and (z=3) ==> (z=3) and (x=1 or y=2). It looks like adding int nodeCount; to RexNode would be helpful to rank rex nodes.
4) There are other bugs identified by expression fuzzer (like and(null, not(null)) conversion to true and so on)
Attachments
Issue Links
- is related to
-
CALCITE-2401 Improve RelMdPredicates performance
- Open
-
CALCITE-4559 Create 'interface RexRule', a modular rewrite for row-expressions
- In Progress
-
CALCITE-2338 Make Simplification API more conservative
- Closed
-
CALCITE-3178 RexSimplify.simplifyOrTerms slow with large OR filters
- Open