You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/04/01 03:18:36 UTC

[GitHub] [incubator-doris] chenhao7253886 commented on a change in pull request #832: Support hll_raw_agg in Aggregate Function

chenhao7253886 commented on a change in pull request #832: Support hll_raw_agg in Aggregate Function
URL: https://github.com/apache/incubator-doris/pull/832#discussion_r270706537
 
 

 ##########
 File path: be/src/exprs/aggregate_functions.cpp
 ##########
 @@ -1114,50 +1115,46 @@ StringVal AggregateFunctions::hll_finalize(FunctionContext* ctx, const StringVal
 }
 
     
-void AggregateFunctions::hll_union_agg_init(FunctionContext* ctx, StringVal* dst) {
-    int str_len = std::pow(2, HLL_PRECISION);
-    dst->is_null = false;
-    dst->ptr = ctx->allocate(str_len);
-    dst->len = str_len;
-    memset(dst->ptr, 0, str_len);
+void AggregateFunctions::hll_union_agg_init(FunctionContext* ctx, HllVal* dst) {
+    dst->init(ctx);
 }
 
-void AggregateFunctions::hll_union_parse_and_cal(HllSetResolver& resolver, StringVal* dst) {
+void AggregateFunctions::hll_union_parse_and_cal(HllSetResolver& resolver, HllVal* dst) {
     
 
 Review comment:
   hll_union_parse_and_cal can be a member of HllVal, and it support a function that merge other type or src StringVal, so we will get a better encapsulation for hll.

----------------------------------------------------------------
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: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org