From 2906544c304ce3c5c5822d2c84b1ac08daa9dfc1 Mon Sep 17 00:00:00 2001 From: fjy Date: Tue, 20 May 2014 10:42:37 -0700 Subject: [PATCH] add a context to force 2 pass algorithm for topNs --- .../src/main/java/io/druid/query/topn/TopNQueryEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/src/main/java/io/druid/query/topn/TopNQueryEngine.java b/processing/src/main/java/io/druid/query/topn/TopNQueryEngine.java index 80a1d0a3bd9..f0716a60407 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQueryEngine.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQueryEngine.java @@ -106,7 +106,7 @@ public class TopNQueryEngine topNAlgorithm = new DimExtractionTopNAlgorithm(capabilities, query); } else if (selector.isAggregateAllMetrics()) { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool); - } else if (selector.isAggregateTopNMetricFirst()) { + } else if (selector.isAggregateTopNMetricFirst() || query.getContextValue("doAggregateTopNMetricFirst", false)) { topNAlgorithm = new AggregateTopNMetricFirstAlgorithm(capabilities, query, bufferPool); } else { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool);