jihoonson commented on a change in pull request #5958: Part 2 of changes for SQL Compatible Null Handling URL: https://github.com/apache/incubator-druid/pull/5958#discussion_r205897566
########## File path: processing/src/main/java/io/druid/query/aggregation/post/DoubleGreatestPostAggregator.java ########## @@ -81,13 +77,15 @@ public Comparator getComparator() public Object compute(Map<String, Object> values) { Iterator<PostAggregator> fieldsIter = fields.iterator(); - double retVal = Double.NEGATIVE_INFINITY; - if (fieldsIter.hasNext()) { - retVal = ((Number) fieldsIter.next().compute(values)).doubleValue(); - while (fieldsIter.hasNext()) { - double other = ((Number) fieldsIter.next().compute(values)).doubleValue(); - if (other > retVal) { - retVal = other; + Double retVal = NullHandling.replaceWithDefault() ? Double.NEGATIVE_INFINITY : null; + while (fieldsIter.hasNext()) { + Number nextVal = ((Number) fieldsIter.next().compute(values)); Review comment: I think so. `compute()` method is called per row on brokers. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org