imay commented on a change in pull request #1432: Add percentile_approx aggregate function URL: https://github.com/apache/incubator-doris/pull/1432#discussion_r301528332
########## File path: be/src/exprs/aggregate_functions.cpp ########## @@ -231,6 +232,84 @@ void AggregateFunctions::avg_update(FunctionContext* ctx, const T& src, StringVa ++avg->count; } +struct PercentileApproxState { +public: + TDigest *digest = nullptr; + double targetQuantile = -1.0; + + ~PercentileApproxState() { + if (digest != nullptr) { Review comment: No need to check if it is nullptr, `delete nullptr` is safe ---------------------------------------------------------------- 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: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org