You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "siddharthteotia (via GitHub)" <gi...@apache.org> on 2023/05/08 00:32:48 UTC

[GitHub] [pinot] siddharthteotia commented on a diff in pull request #10636: Adding ArgMin/ArgMax Function

siddharthteotia commented on code in PR #10636:
URL: https://github.com/apache/pinot/pull/10636#discussion_r1186942140


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AggregationFunctionFactory.java:
##########
@@ -325,6 +325,18 @@ public static AggregationFunction getAggregationFunction(FunctionContext functio
             return new FourthMomentAggregationFunction(firstArgument, FourthMomentAggregationFunction.Type.KURTOSIS);
           case FOURTHMOMENT:
             return new FourthMomentAggregationFunction(firstArgument, FourthMomentAggregationFunction.Type.MOMENT);
+          case PINOTPARENTAGGREGATIONARGMAX:
+            return new ParentArgMinMaxAggregationFunction(arguments, true);
+          case PINOTPARENTAGGREGATIONARGMIN:
+            return new ParentArgMinMaxAggregationFunction(arguments, false);
+          case PINOTCHILDAGGREGATIONARGMAX:
+            return new ChildArgMinMaxAggregationFunction(arguments, true);
+          case PINOTCHILDAGGREGATIONARGMIN:
+            return new ChildArgMinMaxAggregationFunction(arguments, false);
+          case ARGMAX:
+          case ARGMIN:
+            throw new IllegalArgumentException("Aggregation function: " + function
+                + " is only supported in selection without alias.");

Review Comment:
   Not sure I am following this exception. Why do we need to throw this exception for `ARG_MIN` and `ARG_MAX` ?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org