From 956bdf80dd433075b0e865e5d3e1b53a47897688 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Fri, 7 Nov 2014 10:29:06 -0800 Subject: [PATCH] Removed negating comparator in TopNNumericResultBuilder --- .../java/io/druid/query/topn/TopNNumericResultBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processing/src/main/java/io/druid/query/topn/TopNNumericResultBuilder.java b/processing/src/main/java/io/druid/query/topn/TopNNumericResultBuilder.java index 62ddf139eae..e3d66c49955 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNNumericResultBuilder.java +++ b/processing/src/main/java/io/druid/query/topn/TopNNumericResultBuilder.java @@ -181,7 +181,8 @@ public class TopNNumericResultBuilder implements TopNResultBuilder @Override public int compare(DimValHolder d1, DimValHolder d2) { - int retVal = -metricComparator.compare(d1.getTopNMetricVal(), d2.getTopNMetricVal()); + // Values flipped compared to earlier + int retVal = metricComparator.compare(d2.getTopNMetricVal(),d1.getTopNMetricVal()); if (retVal == 0) { retVal = dimNameComparator.compare(d1.getDimName(), d2.getDimName());