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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]