Class FilterJoinRule<C extends FilterJoinRule.Config>

Type Parameters:
C - Configuration type
All Implemented Interfaces:
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


      @Deprecated public static final FilterJoinRule.Predicate TRUE_PREDICATE
      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 = AND =, we can infer = for the first Join node from second Join node's condition: = AND =

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

      rexNodes - the Join condition
      join - the Join node
      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.

      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.