@Override public void onMatch(RelOptRuleCall call) { final LogicalAggregate aggregate = (LogicalAggregate) call.rel(0); final RelNode input = call.rel(1); if (aggregate.containsDistinctCall()) { // currently, don't use this rule if any of the aggregates contains DISTINCT return; } final RelTraitSet traits = aggregate.getTraitSet().plus(Rel.LOGICAL); final RelNode convertedInput = convert(input, input.getTraitSet().plus(Rel.LOGICAL).simplify()); call.transformTo(new AggregateRel(aggregate.getCluster(), traits, convertedInput, aggregate.indicator, aggregate.getGroupSet(), aggregate.getGroupSets(), aggregate.getAggCallList())); } }
@Override public void onMatch(RelOptRuleCall call) { final LogicalAggregate aggregate = call.rel(0); final RelNode input = call.rel(1); if (aggregate.containsDistinctCall()) { // currently, don't use this rule if any of the aggregates contains DISTINCT return; } final RelTraitSet traits = aggregate.getTraitSet().plus(DrillRel.DRILL_LOGICAL); final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL).simplify()); call.transformTo(new DrillAggregateRel(aggregate.getCluster(), traits, convertedInput, aggregate.indicator, aggregate.getGroupSet(), aggregate.getGroupSets(), aggregate.getAggCallList())); } }