Class FlinkAggregateExpandDistinctAggregatesRule

java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.flink.table.planner.plan.rules.logical.FlinkAggregateExpandDistinctAggregatesRule

public final class FlinkAggregateExpandDistinctAggregatesRule extends org.apache.calcite.plan.RelOptRule
Planner rule that expands distinct aggregates (such as COUNT(DISTINCT x)) from a Aggregate.

How this is done depends upon the arguments to the function. If all functions have the same argument (e.g. COUNT(DISTINCT x), SUM(DISTINCT x) both have the argument x) then one extra Aggregate is sufficient.

If there are multiple arguments (e.g. COUNT(DISTINCT x), COUNT(DISTINCT y)) the rule creates separate Aggregates and combines using a Join.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule

    org.apache.calcite.plan.RelOptRule.ConverterRelOptRuleOperand
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The default instance of the rule; operates only on logical expressions.
    Instance of the rule that operates only on logical expressions and generates a join.
    final boolean
     

    Fields inherited from class org.apache.calcite.plan.RelOptRule

    description, operands, relBuilderFactory
  • Constructor Summary

    Constructors
    Constructor
    Description
    FlinkAggregateExpandDistinctAggregatesRule(Class<? extends org.apache.calcite.rel.core.Aggregate> clazz, boolean useGroupingSets, org.apache.calcite.tools.RelBuilderFactory relBuilderFactory)
     
    FlinkAggregateExpandDistinctAggregatesRule(Class<? extends org.apache.calcite.rel.logical.LogicalAggregate> clazz, boolean useGroupingSets, org.apache.calcite.rel.core.RelFactories.JoinFactory joinFactory)
    Deprecated.
    FlinkAggregateExpandDistinctAggregatesRule(Class<? extends org.apache.calcite.rel.logical.LogicalAggregate> clazz, org.apache.calcite.rel.core.RelFactories.JoinFactory joinFactory)
    Deprecated.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onMatch(org.apache.calcite.plan.RelOptRuleCall call)
     

    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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • FlinkAggregateExpandDistinctAggregatesRule

      public FlinkAggregateExpandDistinctAggregatesRule(Class<? extends org.apache.calcite.rel.core.Aggregate> clazz, boolean useGroupingSets, org.apache.calcite.tools.RelBuilderFactory relBuilderFactory)
    • FlinkAggregateExpandDistinctAggregatesRule

      @Deprecated public FlinkAggregateExpandDistinctAggregatesRule(Class<? extends org.apache.calcite.rel.logical.LogicalAggregate> clazz, boolean useGroupingSets, org.apache.calcite.rel.core.RelFactories.JoinFactory joinFactory)
      Deprecated.
    • FlinkAggregateExpandDistinctAggregatesRule

      @Deprecated public FlinkAggregateExpandDistinctAggregatesRule(Class<? extends org.apache.calcite.rel.logical.LogicalAggregate> clazz, org.apache.calcite.rel.core.RelFactories.JoinFactory joinFactory)
      Deprecated.
  • Method Details

    • onMatch

      public void onMatch(org.apache.calcite.plan.RelOptRuleCall call)
      Specified by:
      onMatch in class org.apache.calcite.plan.RelOptRule