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
Nested Classes Modifier and Type Class Description static class
KuduSortRule.KuduFilterVisitor
SearchesRexNode
to see if the Kudu column index -- stored asKuduSortRule.KuduFilterVisitor.mustHave
is present in theRexNode
and is required.static class
KuduSortRule.KuduSortWithFilter
Rule to match a Sort aboveFilter
and it is aboveKuduQuery
.static class
KuduSortRule.KuduSortWithoutFilter
Rule to match a Sort aboveKuduQuery
.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.calcite.plan.RelOptRule
FILTER_SORT_RULE
protected List<Integer>
pkSortColumns
static org.apache.calcite.plan.RelOptRule
SIMPLE_SORT_RULE
-
Constructor Summary
Constructors Constructor Description KuduSortRule(org.apache.calcite.plan.RelOptRuleOperand operand, org.apache.calcite.tools.RelBuilderFactory factory, String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, onMatch, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
-
-
-
Constructor Detail
-
KuduSortRule
public KuduSortRule(org.apache.calcite.plan.RelOptRuleOperand operand, org.apache.calcite.tools.RelBuilderFactory factory, String description)
-
-