Class JoinExpandOrToUnionRule

All Implemented Interfaces:
TransformationRule

@Enclosing public class JoinExpandOrToUnionRule extends RelRule<JoinExpandOrToUnionRule.Config> implements TransformationRule
Planner rule that matches a Join and expands OR clauses in join conditions.

This rule expands OR conditions in join clauses into multiple separate join conditions, allowing the optimizer to handle these conditions more efficiently.

The following is an example of inner join, and other examples for other kinds of joins can be found in the code below.


 Project[*]
    └── Join[OR(t1.id=t2.id, t1.age=t2.age), inner]
        ├── TableScan[t1]
        └── TableScan[t2]
 

into


 Project[*]
    └── UnionAll
        ├── Join[t1.id=t2.id, inner]
        │   ├── TableScan[t1]
        │   └── TableScan[t2]
        └── Join[t1.age=t2.age AND t1.id≠t2.id, inner]
            ├─── TableScan[t1]
            └─── TableScan[t2]