shengyunyao commented on a change in pull request #1939: Added: Add tdigest compression param for pencentile_approx function URL: https://github.com/apache/incubator-doris/pull/1939#discussion_r333337128
########## File path: be/src/exprs/aggregate_functions.cpp ########## @@ -234,20 +234,27 @@ void AggregateFunctions::avg_update(FunctionContext* ctx, const T& src, StringVa struct PercentileApproxState { public: - PercentileApproxState() : digest(new TDigest()){ - } + PercentileApproxState() : digest(new TDigest()) {} + PercentileApproxState(double compression) : digest(new TDigest(compression)) {} ~PercentileApproxState() { delete digest; } - + TDigest *digest = nullptr; double targetQuantile = -1.0; }; void AggregateFunctions::percentile_approx_init(FunctionContext* ctx, StringVal* dst) { + const AnyVal* digest_compression = ctx->get_constant_arg(2); Review comment: If the index exceeds the number of arguments, get_constant_arg() will return a null value. I will check it at line 251. ---------------------------------------------------------------- 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...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org