You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/10/10 05:38:10 UTC

[GitHub] [incubator-doris] shengyunyao commented on a change in pull request #1939: Added: Add tdigest compression param for pencentile_approx function

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:
users@infra.apache.org


With regards,
Apache Git Services

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