siddharthteotia commented on a change in pull request #4535: Implement DISTINCT
clause
URL: https://github.com/apache/incubator-pinot/pull/4535#discussion_r319205954
##########
File path:
pinot-common/src/main/java/org/apache/pinot/pql/parsers/PinotQuery2BrokerRequestConverter.java
##########
@@ -223,31 +226,60 @@ private String standardizeFunction(Function
functionCall) {
private AggregationInfo buildAggregationInfo(Function function) {
List<Expression> operands = function.getOperands();
- if (operands == null || operands.size() != 1) {
- throw new Pql2CompilationException(
- "Aggregation function" + function.getOperator() + " expects 1
argument. found: " + operands);
+ if (operands == null || operands.size() < 1) {
+ throw new Pql2CompilationException("Aggregation function expects non
null argument");
}
- String functionName = function.getOperator();
+
String columnName;
- if (functionName.equalsIgnoreCase("count")) {
- columnName = "*";
+ String functionName = function.getOperator();
+
+ if (functionName.equalsIgnoreCase("distinct")) {
Review comment:
Done
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]