Class KuduSortedAggregationRule

java.lang.Object
org.apache.calcite.plan.RelOptRule
com.twilio.kudu.sql.rules.KuduSortRule
com.twilio.kudu.sql.rules.KuduSortedAggregationRule

public class KuduSortedAggregationRule extends KuduSortRule
Rule that matches a sort over an aggregation with both sort and aggregation using the same columns. The columns must be a prefix of the primary key of the table. This rule eliminates the need for sorting on the client.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.twilio.kudu.sql.rules.KuduSortRule

    KuduSortRule.KuduFilterVisitor, KuduSortRule.KuduSortWithFilter, KuduSortRule.KuduSortWithoutFilter

    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
    static final org.apache.calcite.plan.RelOptRule
     

    Fields inherited from class com.twilio.kudu.sql.rules.KuduSortRule

    FILTER_SORT_RULE, pkSortColumns, SIMPLE_SORT_RULE

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

    description, operands, relBuilderFactory
  • Constructor Summary

    Constructors
    Constructor
    Description
    KuduSortedAggregationRule(org.apache.calcite.tools.RelBuilderFactory relBuilderFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onMatch(org.apache.calcite.plan.RelOptRuleCall call)
     
    protected void
    perform(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Sort originalSort, org.apache.calcite.rel.core.Aggregate originalAggregate, KuduToEnumerableRel kuduToEnumerableRel, org.apache.calcite.rel.core.Project project, org.apache.calcite.rel.core.Filter filter, KuduQuery query)
     

    Methods inherited from class com.twilio.kudu.sql.rules.KuduSortRule

    canApply, perform

    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, 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

    • SORTED_AGGREGATION_RULE

      public static final org.apache.calcite.plan.RelOptRule SORTED_AGGREGATION_RULE
  • Constructor Details

    • KuduSortedAggregationRule

      public KuduSortedAggregationRule(org.apache.calcite.tools.RelBuilderFactory relBuilderFactory)
  • Method Details

    • perform

      protected void perform(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Sort originalSort, org.apache.calcite.rel.core.Aggregate originalAggregate, KuduToEnumerableRel kuduToEnumerableRel, org.apache.calcite.rel.core.Project project, org.apache.calcite.rel.core.Filter filter, KuduQuery query)
    • onMatch

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