Package org.apache.calcite.rel.rules
Class AggregateJoinTransposeRule
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRule
-
- org.apache.calcite.rel.rules.AggregateJoinTransposeRule
-
public class AggregateJoinTransposeRule extends RelOptRule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AggregateJoinTransposeRule.Side
Work space for an input to a join.
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowFunctions
static AggregateJoinTransposeRule
EXTENDED
Extended instance of the rule that can push down aggregate functions.static AggregateJoinTransposeRule
INSTANCE
-
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
-
Constructor Summary
Constructors Constructor Description AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, java.lang.Class<? extends Join> joinClass, RelBuilderFactory relBuilderFactory, boolean allowFunctions)
Creates an AggregateJoinTransposeRule.AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory)
Deprecated.AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory, boolean allowFunctions)
Deprecated.AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory, RelFactories.ProjectFactory projectFactory)
Deprecated.AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory, RelFactories.ProjectFactory projectFactory, boolean allowFunctions)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static ImmutableBitSet
keyColumns(ImmutableBitSet aggregateColumns, com.google.common.collect.ImmutableList<RexNode> predicates)
Computes the closure of a set of columns according to a given list of constraints.void
onMatch(RelOptRuleCall call)
Receives notification about a rule match.private static void
populateEquivalence(java.util.Map<java.lang.Integer,java.util.BitSet> equivalence, int i0, int i1)
private static void
populateEquivalences(java.util.Map<java.lang.Integer,java.util.BitSet> equivalence, RexNode predicate)
private static <E> SqlSplittableAggFunction.Registry<E>
registry(java.util.List<E> list)
Creates aSqlSplittableAggFunction.Registry
that is a view of a list.-
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 AggregateJoinTransposeRule INSTANCE
-
EXTENDED
public static final AggregateJoinTransposeRule EXTENDED
Extended instance of the rule that can push down aggregate functions.
-
allowFunctions
private final boolean allowFunctions
-
-
Constructor Detail
-
AggregateJoinTransposeRule
public AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, java.lang.Class<? extends Join> joinClass, RelBuilderFactory relBuilderFactory, boolean allowFunctions)
Creates an AggregateJoinTransposeRule.
-
AggregateJoinTransposeRule
@Deprecated public AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory)
Deprecated.
-
AggregateJoinTransposeRule
@Deprecated public AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory, boolean allowFunctions)
Deprecated.
-
AggregateJoinTransposeRule
@Deprecated public AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory, RelFactories.ProjectFactory projectFactory)
Deprecated.
-
AggregateJoinTransposeRule
@Deprecated public AggregateJoinTransposeRule(java.lang.Class<? extends Aggregate> aggregateClass, RelFactories.AggregateFactory aggregateFactory, java.lang.Class<? extends Join> joinClass, RelFactories.JoinFactory joinFactory, RelFactories.ProjectFactory projectFactory, boolean allowFunctions)
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)
-
keyColumns
private static ImmutableBitSet keyColumns(ImmutableBitSet aggregateColumns, com.google.common.collect.ImmutableList<RexNode> predicates)
Computes the closure of a set of columns according to a given list of constraints. Each 'x = y' constraint causes bit y to be set if bit x is set, and vice versa.
-
populateEquivalences
private static void populateEquivalences(java.util.Map<java.lang.Integer,java.util.BitSet> equivalence, RexNode predicate)
-
populateEquivalence
private static void populateEquivalence(java.util.Map<java.lang.Integer,java.util.BitSet> equivalence, int i0, int i1)
-
registry
private static <E> SqlSplittableAggFunction.Registry<E> registry(java.util.List<E> list)
Creates aSqlSplittableAggFunction.Registry
that is a view of a list.
-
-