Class RelDecorrelator.RemoveSingleAggregateRule

  • Enclosing class:
    RelDecorrelator

    public static final class RelDecorrelator.RemoveSingleAggregateRule
    extends org.apache.calcite.plan.RelRule<RelDecorrelator.RemoveSingleAggregateRule.RemoveSingleAggregateRuleConfig>
    Rule to remove an Aggregate with SINGLE_VALUE. For cases like:

    Aggregate(SINGLE_VALUE) Project(single expression) Aggregate

    For instance (subtree taken from TPCH query 17):

    LogicalAggregate(group=[{}], agg#0=[SINGLE_VALUE($0)]) LogicalProject(EXPR$0=[*(0.2:DECIMAL(2, 1), $0)]) LogicalAggregate(group=[{}], agg#0=[AVG($0)]) LogicalProject(L_QUANTITY=[$4]) LogicalFilter(condition=[=($1, $cor0.P_PARTKEY)]) LogicalTableScan(table=[[TPCH_01, LINEITEM]])

    Will be converted into:

    LogicalProject($f0=[*(0.2:DECIMAL(2, 1), $0)]) LogicalAggregate(group=[{}], agg#0=[AVG($0)]) LogicalProject(L_QUANTITY=[$4]) LogicalFilter(condition=[=($1, $cor0.P_PARTKEY)]) LogicalTableScan(table=[[TPCH_01, LINEITEM]])

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  RelDecorrelator.RemoveSingleAggregateRule.RemoveSingleAggregateRuleConfig
      Rule configuration.
      • Nested classes/interfaces inherited from class org.apache.calcite.plan.RelRule

        org.apache.calcite.plan.RelRule.Config, org.apache.calcite.plan.RelRule.Done, org.apache.calcite.plan.RelRule.MatchHandler<R extends org.apache.calcite.plan.RelOptRule>, org.apache.calcite.plan.RelRule.OperandBuilder, org.apache.calcite.plan.RelRule.OperandDetailBuilder<R extends org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelRule.OperandTransform
      • 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.RelRule

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

        description, operands, relBuilderFactory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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
    • Method Detail

      • onMatch

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