gianm commented on a change in pull request #6505: Add default comparison to
HavingSpecMetricComparator for custom Aggregator types
URL: https://github.com/apache/incubator-druid/pull/6505#discussion_r228362609
##########
File path:
processing/src/main/java/org/apache/druid/query/groupby/having/HavingSpecMetricComparator.java
##########
@@ -73,6 +73,9 @@ static int compare(String aggregationName, Number value,
Map<String, AggregatorF
double d = Double.parseDouble(metricValueStr);
return Double.compare(d, value.doubleValue());
}
+ } else if (metricValueObj instanceof Number) {
+ BigDecimal d = new BigDecimal(metricValueObj.toString());
+ return d.compareTo((BigDecimal) value);
Review comment:
This code assumes that Numbers that are not Float/Double/Integer/Long are
BigDecimal, which is not correct.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]