Package org.apache.calcite.rel.rules
Class AggregateUnionAggregateRule
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRule
-
- org.apache.calcite.rel.rules.AggregateUnionAggregateRule
-
public class AggregateUnionAggregateRule extends RelOptRule
-
-
Field Summary
Fields Modifier and Type Field Description static AggregateUnionAggregateRule
AGG_ON_FIRST_INPUT
Instance that matches anAggregate
as the left input ofUnion
.static AggregateUnionAggregateRule
AGG_ON_SECOND_INPUT
Instance that matches anAggregate
as the right input ofUnion
.static AggregateUnionAggregateRule
INSTANCE
Instance that matches anAggregate
as either input ofUnion
.-
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
-
Constructor Summary
Constructors Constructor Description AggregateUnionAggregateRule(java.lang.Class<? extends Aggregate> aggregateClass, java.lang.Class<? extends Union> unionClass, java.lang.Class<? extends RelNode> firstUnionInputClass, java.lang.Class<? extends RelNode> secondUnionInputClass, RelBuilderFactory relBuilderFactory, java.lang.String desc)
Creates a AggregateUnionAggregateRule.AggregateUnionAggregateRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Union> unionClass, RelFactories.SetOpFactory setOpFactory)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onMatch(RelOptRuleCall call)
Receives notification about a rule match.-
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
-
AGG_ON_FIRST_INPUT
public static final AggregateUnionAggregateRule AGG_ON_FIRST_INPUT
Instance that matches anAggregate
as the left input ofUnion
.
-
AGG_ON_SECOND_INPUT
public static final AggregateUnionAggregateRule AGG_ON_SECOND_INPUT
Instance that matches anAggregate
as the right input ofUnion
.
-
INSTANCE
public static final AggregateUnionAggregateRule INSTANCE
Instance that matches anAggregate
as either input ofUnion
.Because it matches
RelNode
for each input ofUnion
, it will create O(N ^ 2) matches, which may cost too much during the popMatch phase in VolcanoPlanner. If efficiency is a concern, we recommend that you useAGG_ON_FIRST_INPUT
andAGG_ON_SECOND_INPUT
instead.
-
-
Constructor Detail
-
AggregateUnionAggregateRule
public AggregateUnionAggregateRule(java.lang.Class<? extends Aggregate> aggregateClass, java.lang.Class<? extends Union> unionClass, java.lang.Class<? extends RelNode> firstUnionInputClass, java.lang.Class<? extends RelNode> secondUnionInputClass, RelBuilderFactory relBuilderFactory, java.lang.String desc)
Creates a AggregateUnionAggregateRule.
-
AggregateUnionAggregateRule
@Deprecated public AggregateUnionAggregateRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Union> unionClass, RelFactories.SetOpFactory setOpFactory)
Deprecated.
-
-
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)
-
-