Package org.apache.calcite.rel.rules
Class SemiJoinJoinTransposeRule
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRule
-
- org.apache.calcite.rel.rules.SemiJoinJoinTransposeRule
-
public class SemiJoinJoinTransposeRule extends RelOptRule
Planner rule that pushes aSemiJoin
down in a tree past aJoin
in order to trigger other rules that will convertSemiJoin
s.- SemiJoin(LogicalJoin(X, Y), Z) → LogicalJoin(SemiJoin(X, Z), Y)
- SemiJoin(LogicalJoin(X, Y), Z) → LogicalJoin(X, SemiJoin(Y, Z))
Whether this first or second conversion is applied depends on which operands actually participate in the semi-join.
-
-
Field Summary
Fields Modifier and Type Field Description static SemiJoinJoinTransposeRule
INSTANCE
-
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
-
Constructor Summary
Constructors Constructor Description SemiJoinJoinTransposeRule(RelBuilderFactory relBuilderFactory)
Creates a SemiJoinJoinTransposeRule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onMatch(RelOptRuleCall call)
Receives notification about a rule match.private void
setJoinAdjustments(int[] adjustments, int nFieldsX, int nFieldsY, int nFieldsZ, int adjustY, int adjustZ)
Sets an array to reflect how much each index corresponding to a field needs to be adjusted.-
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
-
-
-
-
Field Detail
-
INSTANCE
public static final SemiJoinJoinTransposeRule INSTANCE
-
-
Constructor Detail
-
SemiJoinJoinTransposeRule
public SemiJoinJoinTransposeRule(RelBuilderFactory relBuilderFactory)
Creates a SemiJoinJoinTransposeRule.
-
-
Method Detail
-
onMatch
public void onMatch(RelOptRuleCall call)
Description copied from class:RelOptRule
Receives notification about a rule match. At the time that this method is called,call.rels
holds the set of relational expressions which match the operands to the rule;call.rels[0]
is the root expression.Typically a rule would check that the nodes are valid matches, creates a new expression, then calls back
RelOptRuleCall.transformTo(org.apache.calcite.rel.RelNode, java.util.Map<org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode>)
to register the expression.- Specified by:
onMatch
in classRelOptRule
- Parameters:
call
- Rule call- See Also:
RelOptRule.matches(RelOptRuleCall)
-
setJoinAdjustments
private void setJoinAdjustments(int[] adjustments, int nFieldsX, int nFieldsY, int nFieldsZ, int adjustY, int adjustZ)
Sets an array to reflect how much each index corresponding to a field needs to be adjusted. The array corresponds to fields in a 3-way join between (X, Y, and Z). X remains unchanged, but Y and Z need to be adjusted by some fixed amount as determined by the input.- Parameters:
adjustments
- array to be filled outnFieldsX
- number of fields in XnFieldsY
- number of fields in YnFieldsZ
- number of fields in ZadjustY
- the amount to adjust Y byadjustZ
- the amount to adjust Z by
-
-