mayankshriv commented on a change in pull request #5339: URL: https://github.com/apache/incubator-pinot/pull/5339#discussion_r421060734
########## File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AggregationFunctionUtils.java ########## @@ -182,4 +187,37 @@ public static String concatArgs(List<String> arguments) { return (arguments.size() > 1) ? String.join(CompilerConstants.AGGREGATION_FUNCTION_ARG_SEPARATOR, arguments) : arguments.get(0); } + + /** + * Compiles and returns all transform expressions required for computing the aggregation, group-by + * and order-by + * + * @param brokerRequest Broker Request + * @param functionContexts Aggregation Function contexts + * @return Set of compiled expressions in the aggregation, group-by and order-by clauses + */ + public static Set<TransformExpressionTree> collectExpressionsToTransform(BrokerRequest brokerRequest, + AggregationFunctionContext[] functionContexts) { + + Set<TransformExpressionTree> expressionTrees = new LinkedHashSet<>(); + for (AggregationFunctionContext functionContext : functionContexts) { + AggregationFunction function = functionContext.getAggregationFunction(); + + // Count is always treated as count(*) and does not need any columns to be projected. + if (!function.getType().equals(AggregationFunctionType.COUNT)) { Review comment: 👍 ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org