Class FlinkFilterJoinRule<C extends FlinkFilterJoinRule.Config>
java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.calcite.plan.RelRule<C>
org.apache.flink.table.planner.plan.rules.logical.FlinkFilterJoinRule<C>
- All Implemented Interfaces:
org.apache.calcite.rel.rules.TransformationRule
- Direct Known Subclasses:
FlinkFilterJoinRule.FlinkFilterIntoJoinRule,FlinkFilterJoinRule.FlinkJoinConditionPushRule
public abstract class FlinkFilterJoinRule<C extends FlinkFilterJoinRule.Config>
extends org.apache.calcite.plan.RelRule<C>
implements org.apache.calcite.rel.rules.TransformationRule
Planner rule that pushes filters above and within a join node into the join node and/or its
children nodes.
SELECT * FROM MyTable1 join MyTable2 ON a1 = a2 AND a1 = 2
SELECT * FROM MyTable1, MyTable2 WHERE a1 = a2 AND a1 = 2
This rule is copied from FilterJoinRule.
Different from FilterJoinRule, this rule can handle more cases: for the above filter
of inner/left/right join or the join condition of inner join, the predicate which field
references are all from one side join condition can be pushed into another join side. Such as:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRule configuration.static classRule that tries to push filter expressions into a join condition and into the inputs of the join.static classRule that pushes parts of the join condition to its inputs.static interfacePredicate that returns whether a filter is valid in the ON clause of a join for this particular kind of join.Nested classes/interfaces inherited from class org.apache.calcite.plan.RelRule
org.apache.calcite.plan.RelRule.Done, org.apache.calcite.plan.RelRule.MatchHandler<R extends org.apache.calcite.plan.RelOptRule>, org.apache.calcite.plan.RelRule.OperandBuilder, org.apache.calcite.plan.RelRule.OperandDetailBuilder<R extends org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelRule.OperandTransformNested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule
org.apache.calcite.plan.RelOptRule.ConverterRelOptRuleOperand -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FlinkFilterJoinRule.FlinkFilterIntoJoinRulestatic final FlinkFilterJoinRule.FlinkJoinConditionPushRulestatic final Set<org.apache.calcite.sql.SqlKind>Fields inherited from class org.apache.calcite.plan.RelRule
configFields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisEventTimeTemporalJoin(org.apache.calcite.rex.RexNode joinCondition) protected voidperform(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Filter filter, org.apache.calcite.rel.core.Join join) protected voidvalidateJoinFilters(List<org.apache.calcite.rex.RexNode> aboveFilters, List<org.apache.calcite.rex.RexNode> joinFilters, org.apache.calcite.rel.core.Join join, org.apache.calcite.rel.core.JoinRelType joinType) Validates that target execution framework can satisfy join filters.Methods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, onMatch, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
Field Details
-
FILTER_INTO_JOIN
-
JOIN_CONDITION_PUSH
-
SUITABLE_FILTER_TO_PUSH
-
-
Constructor Details
-
FlinkFilterJoinRule
Creates a FilterJoinRule.
-
-
Method Details
-
perform
protected void perform(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Filter filter, org.apache.calcite.rel.core.Join join) -
validateJoinFilters
protected void validateJoinFilters(List<org.apache.calcite.rex.RexNode> aboveFilters, List<org.apache.calcite.rex.RexNode> joinFilters, org.apache.calcite.rel.core.Join join, org.apache.calcite.rel.core.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.c2and the join only supports equi-join), removes the filter fromjoinFiltersand adds it toaboveFilters.The default implementation does nothing; i.e. the join can handle all conditions.
- Parameters:
aboveFilters- Filter above JoinjoinFilters- Filters in join conditionjoin- JoinjoinType- JoinRelType could be different from type in Join due to outer join simplification.
-
isEventTimeTemporalJoin
protected boolean isEventTimeTemporalJoin(org.apache.calcite.rex.RexNode joinCondition)
-