Class FilterJoinRule<C extends FilterJoinRule.Config>

Type Parameters:
C - Configuration type
All Implemented Interfaces:
TransformationRule
Direct Known Subclasses:
FilterJoinRule.FilterIntoJoinRule, FilterJoinRule.JoinConditionPushRule

public abstract class FilterJoinRule<C extends FilterJoinRule.Config> extends RelRule<C> implements TransformationRule
Planner rule that pushes filters above and within a join node into the join node and/or its children nodes.
  • Field Details

    • TRUE_PREDICATE

      @Deprecated public static final FilterJoinRule.Predicate TRUE_PREDICATE
      Deprecated.
      Predicate that always returns true. With this predicate, every filter will be pushed into the ON clause.
  • Constructor Details

    • FilterJoinRule

      protected FilterJoinRule(C config)
      Creates a FilterJoinRule.
  • Method Details

    • perform

      protected void perform(RelOptRuleCall call, @Nullable Filter filter, Join join)
    • inferJoinEqualConditions

      protected List<RexNode> inferJoinEqualConditions(List<RexNode> rexNodes, Join join)
      Infers more equal conditions for the join condition.

      For example, in SELECT * FROM T1, T2, T3 WHERE T1.id = T3.id AND T2.id = T3.id, we can infer T1.id = T2.id for the first Join node from second Join node's condition: T1.id = T3.id AND T2.id = T3.id.

      For the above SQL, the second Join's condition is T1.id = T3.id AND T2.id = T3.id. After inference, the final condition would be: T1.id = T2.id AND T1.id = T3.id, the T1.id = T2.id can be further pushed into LHS.

      Parameters:
      rexNodes - the Join condition
      join - the Join node
      Returns:
      the newly inferred conditions
    • validateJoinFilters

      protected void validateJoinFilters(List<RexNode> aboveFilters, List<RexNode> joinFilters, Join join, JoinRelType joinType)
      Validates that target execution framework can satisfy join filters.

      If the join filter cannot be satisfied (for example, if it is l.c1 > r.c2 and the join only supports equi-join), removes the filter from joinFilters and adds it to aboveFilters.

      The default implementation does nothing; i.e. the join can handle all conditions.

      Parameters:
      aboveFilters - Filter above Join
      joinFilters - Filters in join condition
      join - Join
      joinType - JoinRelType could be different from type in Join due to outer join simplification.