Optimizer: refactor outer to inner join conversion as a separate rule
ghazalfamilyusa opened this issue · comments
ghazalfamilyusa commented
Enhancement
Currently, the outer to inner join rewrite is part of the predicate push down. This is causing confusion and difficulty in extending of both rewrites. Also, the current implementation of outer to inner join rewrite has unnecessary special cases and error prone. Also, the unit test cases currently are very limited and we need more coverage of the scope.
Details
The enhancement will basically accomplish the following:
- Create a new rule "outer_to_inner_join" and add it to the logical optimizations rule set. The rule is indepedent of the predicate push down and precedes it since it can trigger it.
- Simplify the logic for AND/OR predicates and remove special cases.
- Detailed unit test that covers all scenarios.