public static class DruidRules.DruidAggregateProjectRule extends RelOptRule
description, operands, relBuilderFactory| Constructor and Description |
|---|
DruidAggregateProjectRule(RelBuilderFactory relBuilderFactory)
Creates a DruidAggregateProjectRule.
|
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
allAggregatesHaveFilters(List<AggregateCall> calls) |
private static List<RelNode> |
constructNewNodes(List<RelNode> oldNodes,
boolean addFilter,
int startIndex,
RelNode filter,
RelNode... trailingNodes)
Returns a new List of RelNodes in the order of the given order of the oldNodes,
the given
Filter, and any extra nodes. |
private static List<Integer> |
getFilterRefs(List<AggregateCall> calls) |
private Set<Integer> |
getUniqueFilterRefs(List<AggregateCall> calls)
Returns an array of unique filter references from
the given list of
AggregateCall |
void |
onMatch(RelOptRuleCall call) |
private DruidQuery |
optimizeFilteredAggregations(RelOptRuleCall call,
DruidQuery query,
Project project,
Aggregate aggregate)
Attempts to optimize any aggregations with filters in the DruidQuery.
|
private static RexNode |
stripFilter(RexNode node) |
any, convert, convert, convertList, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, some, toString, unorderedpublic DruidAggregateProjectRule(RelBuilderFactory relBuilderFactory)
relBuilderFactory - Builder for relational expressionspublic void onMatch(RelOptRuleCall call)
onMatch in class RelOptRuleprivate Set<Integer> getUniqueFilterRefs(List<AggregateCall> calls)
AggregateCallprivate DruidQuery optimizeFilteredAggregations(RelOptRuleCall call, DruidQuery query, Project project, Aggregate aggregate)
Should be called before pushing both the aggregate and project into Druid. Assumes that at least one aggregate call has a filter attached to it.
private static boolean allAggregatesHaveFilters(List<AggregateCall> calls)
private static List<RelNode> constructNewNodes(List<RelNode> oldNodes, boolean addFilter, int startIndex, RelNode filter, RelNode... trailingNodes)
Filter, and any extra nodes.private static List<Integer> getFilterRefs(List<AggregateCall> calls)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.