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


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AggregationFunctionFactory.java:
##########
@@ -143,6 +143,31 @@ public static AggregationFunction 
getAggregationFunction(FunctionContext functio
             // PercentileRawTDigestMV
             return new 
PercentileRawTDigestMVAggregationFunction(firstArgument, percentile);
           }
+        } else if (numArguments == 3) {
+          // Triple arguments percentile (e.g. percentileTDigest(bar, 95, 
1000), etc.) where the
+          // second argument is a decimal number from 0.0 to 100.0 and third 
argument is a decimal number indicating
+          // the compression_factor for the TDigest. This can only be used for 
TDigest type percentile functions to
+          // pass in a custom compression_factor. If the two argument version 
is used the default compression_factor
+          // of 100.0 is used.
+          // Have to use literal string because we need to cast int to double 
here.
+          double percentile = 
parsePercentileToDouble(arguments.get(1).getLiteral().getStringValue());
+          double compressionFactor = 
parseCompressionFactorToDouble(arguments.get(2).getLiteral().getStringValue());

Review Comment:
   Should we validate compressionFactor > 0 or greater than some minimum ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to