public abstract class FlinkFilterJoinRule<C extends FlinkFilterJoinRule.Config>
extends org.apache.calcite.plan.RelRule<C>
implements org.apache.calcite.rel.rules.TransformationRule
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:
Modifier and Type | Class and Description |
---|---|
static interface |
FlinkFilterJoinRule.Config
Rule configuration.
|
static class |
FlinkFilterJoinRule.FlinkFilterIntoJoinRule
Rule that tries to push filter expressions into a join condition and into the inputs of the
join.
|
static class |
FlinkFilterJoinRule.FlinkJoinConditionPushRule
Rule that pushes parts of the join condition to its inputs.
|
static interface |
FlinkFilterJoinRule.Predicate
Predicate that returns whether a filter is valid in the ON clause of a join for this
particular kind of join.
|
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.OperandTransform
Modifier and Type | Field and Description |
---|---|
static FlinkFilterJoinRule.FlinkFilterIntoJoinRule |
FILTER_INTO_JOIN |
static FlinkFilterJoinRule.FlinkJoinConditionPushRule |
JOIN_CONDITION_PUSH |
static Set<org.apache.calcite.sql.SqlKind> |
SUITABLE_FILTER_TO_PUSH |
Modifier | Constructor and Description |
---|---|
protected |
FlinkFilterJoinRule(C config)
Creates a FilterJoinRule.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
isEventTimeTemporalJoin(org.apache.calcite.rex.RexNode joinCondition) |
protected void |
perform(org.apache.calcite.plan.RelOptRuleCall call,
Filter filter,
org.apache.calcite.rel.core.Join join) |
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.
|
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
public static final FlinkFilterJoinRule.FlinkFilterIntoJoinRule FILTER_INTO_JOIN
public static final FlinkFilterJoinRule.FlinkJoinConditionPushRule JOIN_CONDITION_PUSH
public static final Set<org.apache.calcite.sql.SqlKind> SUITABLE_FILTER_TO_PUSH
protected FlinkFilterJoinRule(C config)
protected void perform(org.apache.calcite.plan.RelOptRuleCall call, Filter filter, org.apache.calcite.rel.core.Join join)
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)
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 JoinjoinFilters
- Filters in join conditionjoin
- JoinjoinType
- JoinRelType could be different from type in Join due to outer join
simplification.protected boolean isEventTimeTemporalJoin(org.apache.calcite.rex.RexNode joinCondition)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.