Class FlinkBushyJoinReorderRule
- All Implemented Interfaces:
org.apache.calcite.rel.rules.TransformationRule
MultiJoin to a bushy join tree.
In this bushy join reorder strategy, the join reorder step is as follows:
First step, we will reorder all the inner join type inputs in the multiJoin. We adopt the
concept of level in dynamic programming, and the latter layer will use the results stored in the
previous levels. First, we put all input factor (each input factor in MultiJoin) into
level 0, then we build all two-inputs join at level 1 based on the FlinkCost of level 0,
then we will build three-inputs join based on the previous two levels, then four-inputs joins ...
etc, util we reorder all the inner join type input factors in the multiJoin. When building
m-inputs join, we only keep the best plan (have the lowest FlinkCost) for the same set of
m inputs. E.g., for three-inputs join, we keep only the best plan for inputs {A, B, C} among
plans (A J B) J C, (A J C) J B, (B J C) J A.
Second step, we will add all outer join factors to the top of reordered join tree generated by the first step. E.g., for the example (((A LJ B) IJ C) IJ D). we will first reorder A, C and D using the first step strategy, get ((A IJ C) IJ D). Then, we will add B to the top, get (((A IJ C) IJ D) LJ B).
Third step, we will add all cross join factors whose join condition is true to the top in the final step.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRule configuration.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
Fields inherited from class org.apache.calcite.plan.RelRule
configFields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory -
Constructor Summary
ConstructorsModifierConstructorDescriptionFlinkBushyJoinReorderRule(org.apache.calcite.rel.core.RelFactories.JoinFactory joinFactory, org.apache.calcite.rel.core.RelFactories.ProjectFactory projectFactory, org.apache.calcite.rel.core.RelFactories.FilterFactory filterFactory) Deprecated.FlinkBushyJoinReorderRule(org.apache.calcite.tools.RelBuilderFactory relBuilderFactory) Deprecated.protectedCreates a FlinkBushyJoinReorderRule. -
Method Summary
Methods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
Constructor Details
-
FlinkBushyJoinReorderRule
Creates a FlinkBushyJoinReorderRule. -
FlinkBushyJoinReorderRule
@Deprecated public FlinkBushyJoinReorderRule(org.apache.calcite.tools.RelBuilderFactory relBuilderFactory) Deprecated. -
FlinkBushyJoinReorderRule
@Deprecated public FlinkBushyJoinReorderRule(org.apache.calcite.rel.core.RelFactories.JoinFactory joinFactory, org.apache.calcite.rel.core.RelFactories.ProjectFactory projectFactory, org.apache.calcite.rel.core.RelFactories.FilterFactory filterFactory) Deprecated.
-
-
Method Details
-
onMatch
public void onMatch(org.apache.calcite.plan.RelOptRuleCall call) - Specified by:
onMatchin classorg.apache.calcite.plan.RelOptRule
-