diff --git a/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java b/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java index 81776df032c..f017cad0d2a 100644 --- a/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java +++ b/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.base.Preconditions; -import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Ordering; @@ -55,7 +54,6 @@ import io.druid.query.groupby.orderby.DefaultLimitSpec; import io.druid.query.groupby.orderby.LimitSpec; import io.druid.query.groupby.orderby.NoopLimitSpec; import io.druid.query.groupby.orderby.OrderByColumnSpec; -import io.druid.query.groupby.strategy.GroupByStrategyV2; import io.druid.query.ordering.StringComparator; import io.druid.query.ordering.StringComparators; import io.druid.query.spec.LegacySegmentSpec; @@ -102,7 +100,6 @@ public class GroupByQuery extends BaseQuery private final List aggregatorSpecs; private final List postAggregatorSpecs; - private final Function, Sequence> limitFn; private final boolean applyLimitPushDown; private final Function, Sequence> postProcessingFn; @@ -201,42 +198,6 @@ public class GroupByQuery extends BaseQuery // Check if limit push down configuration is valid and check if limit push down will be applied this.applyLimitPushDown = determineApplyLimitPushDown(); - - // On an inner query, we may sometimes get a LimitSpec so that row orderings can be determined for limit push down - // However, it's not necessary to build the real limitFn from it at this stage. - Function, Sequence> postProcFn; - if (getContextBoolean(GroupByStrategyV2.CTX_KEY_OUTERMOST, true)) { - postProcFn = this.limitSpec.build(this.dimensions, this.aggregatorSpecs, this.postAggregatorSpecs); - } else { - postProcFn = NoopLimitSpec.INSTANCE.build(this.dimensions, this.aggregatorSpecs, this.postAggregatorSpecs); - } - - if (havingSpec != null) { - postProcFn = Functions.compose( - postProcFn, - new Function, Sequence>() - { - @Override - public Sequence apply(Sequence input) - { - GroupByQuery.this.havingSpec.setRowSignature(GroupByQueryHelper.rowSignatureFor(GroupByQuery.this)); - return Sequences.filter( - input, - new Predicate() - { - @Override - public boolean apply(Row input) - { - return GroupByQuery.this.havingSpec.eval(input); - } - } - ); - } - } - ); - } - - limitFn = postProcFn; } @JsonProperty