Package com.twilio.kudu.sql.rules
Class KuduSortRule
java.lang.Object
org.apache.calcite.plan.RelOptRule
com.twilio.kudu.sql.rules.KuduSortRule
- Direct Known Subclasses:
KuduSortedAggregationRule
,KuduSortRule.KuduSortWithFilter
,KuduSortRule.KuduSortWithoutFilter
public abstract class KuduSortRule
extends org.apache.calcite.plan.RelOptRule
Two Sort Rules that look to push the Sort into the Kudu RPC. Rule that pushes
down the sort into kudu if we are sorting by columns that are a prefix of the
primary key columns in the table. This rule eliminates sorting on the client.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
SearchesRexNode
to see if the Kudu column index -- stored asKuduSortRule.KuduFilterVisitor.mustHave
is present in theRexNode
and is required.static class
Rule to match a Sort aboveFilter
and it is aboveKuduQuery
.static class
Rule to match a Sort aboveKuduQuery
.Nested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule
org.apache.calcite.plan.RelOptRule.ConverterRelOptRuleOperand
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.calcite.plan.RelOptRule
static final org.apache.calcite.plan.RelOptRule
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
Constructor Summary
ConstructorDescriptionKuduSortRule
(org.apache.calcite.plan.RelOptRuleOperand operand, org.apache.calcite.tools.RelBuilderFactory factory, String description) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canApply
(org.apache.calcite.plan.RelTraitSet sortTraits, org.apache.calcite.rex.RexNode offset, KuduQuery query, org.apache.kudu.client.KuduTable openedTable, Optional<org.apache.calcite.rel.core.Filter> filter) void
perform
(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Sort originalSort, KuduQuery query, org.apache.kudu.client.KuduTable openedTable, Optional<org.apache.calcite.rel.core.Filter> filter) 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
-
Field Details
-
SIMPLE_SORT_RULE
public static final org.apache.calcite.plan.RelOptRule SIMPLE_SORT_RULE -
FILTER_SORT_RULE
public static final org.apache.calcite.plan.RelOptRule FILTER_SORT_RULE -
pkSortColumns
-
-
Constructor Details
-
KuduSortRule
public KuduSortRule(org.apache.calcite.plan.RelOptRuleOperand operand, org.apache.calcite.tools.RelBuilderFactory factory, String description)
-
-
Method Details
-
canApply
-
perform
-