public class HiveJoinConstraintsRule
extends org.apache.calcite.plan.RelOptRule
The rule can perform two different optimizations.
1) Removes a join if is does not alter the cardinality of the one of its inputs.
In particular, this rule is triggered if:
- it is a join on PK-FK/UK-FK,
- project on top only references columns from the FK side, and
- PK/UK side is not filtered
It optionally adds an IS NOT NULL filter if any FK column can be nullable
2) Transforms a left/right outer join into an inner join if:
- it is a join on PK-FK/UK-FK,
- FK is not nullable
- PK/UK side is not filtered