Class AggregateMergeRule

java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.druid.sql.calcite.rule.AggregateMergeRule
Direct Known Subclasses:
AggregateMergeRule.WithoutProject, AggregateMergeRule.WithProject

public abstract class AggregateMergeRule extends org.apache.calcite.plan.RelOptRule
Modified version of Calcite's AggregateMergeRule, with two changes: (1) Includes a workaround for https://issues.apache.org/jira/browse/CALCITE-7162 (2) Includes the ability to merge two Aggregate with a Project between them, by pushing the Project below the new merged Aggregate. This is done by AggregateMergeRule.WithProject.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Implementation matching an Aggregate on top of an Aggregate without any intervening Project.
    static class 
    Implementation matching an Aggregate on top of an Aggregate with an intervening Project.

    Nested 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.RelOptRule

    description, operands, relBuilderFactory
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AggregateMergeRule(org.apache.calcite.plan.RelOptRuleOperand operand, String description)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.calcite.rel.RelNode
    apply(org.apache.calcite.rel.core.Aggregate topAgg, org.apache.calcite.rel.core.Aggregate bottomAgg)
    Logic borrowed from Calcite's AggregateMergeRule to merge two Aggregate, with modification to work around https://issues.apache.org/jira/browse/CALCITE-7162.

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

    any, convert, convert, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, onMatch, 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
  • Constructor Details

    • AggregateMergeRule

      protected AggregateMergeRule(org.apache.calcite.plan.RelOptRuleOperand operand, String description)
  • Method Details

    • apply

      @Nullable protected org.apache.calcite.rel.RelNode apply(org.apache.calcite.rel.core.Aggregate topAgg, org.apache.calcite.rel.core.Aggregate bottomAgg)
      Logic borrowed from Calcite's AggregateMergeRule to merge two Aggregate, with modification to work around https://issues.apache.org/jira/browse/CALCITE-7162.