Jackie-Jiang commented on a change in pull request #4535: Implement DISTINCT clause URL: https://github.com/apache/incubator-pinot/pull/4535#discussion_r324928495
########## File path: pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/FunctionCallAstNode.java ########## @@ -75,22 +80,53 @@ public String getExpression() { return _expression; } - public AggregationInfo buildAggregationInfo() { + AggregationInfo buildAggregationInfo() { String expression; // COUNT aggregation function always works on '*' - if (_name.equalsIgnoreCase("count")) { + if (_name.equalsIgnoreCase(AggregationFunctionType.COUNT.getName())) { expression = "*"; } else { List<? extends AstNode> children = getChildren(); - if (children == null || children.size() != 1) { - throw new Pql2CompilationException("Aggregation function expects exact 1 argument"); + if (children == null || children.size() < 1) { Review comment: (nit) if (children == null || children.isEmpty()) ---------------------------------------------------------------- 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...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org