clintropolis commented on a change in pull request #8815: SQL: EARLIEST, LATEST aggregators. URL: https://github.com/apache/incubator-druid/pull/8815#discussion_r344375327
########## File path: sql/src/main/java/org/apache/druid/sql/calcite/aggregation/Aggregations.java ########## @@ -48,10 +49,18 @@ private Aggregations() final Project project ) { - return call.getArgList().stream() - .map(i -> Expressions.fromFieldAccess(rowSignature, project, i)) - .map(rexNode -> toDruidExpressionForSimpleAggregator(plannerContext, rowSignature, rexNode)) - .collect(Collectors.toList()); + final List<DruidExpression> args = call + .getArgList() + .stream() + .map(i -> Expressions.fromFieldAccess(rowSignature, project, i)) + .map(rexNode -> toDruidExpressionForSimpleAggregator(plannerContext, rowSignature, rexNode)) + .collect(Collectors.toList()); + + if (args.stream().noneMatch(Objects::isNull)) { Review comment: Could you add a comment here explaining why we do this part? It seems not obvious to me ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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