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/03/28 14:29:55 UTC

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

imay 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_r270030277
 
 

 ##########
 File path: be/src/exprs/aggregate_functions.cpp
 ##########
 @@ -1241,6 +1241,38 @@ int64_t AggregateFunctions::hll_algorithm(const doris_udf::StringVal& src) {
     return (int64_t)(estimate + 0.5);
 }
 
+void AggregateFunctions::hll_raw_agg_init(
+        FunctionContext* ctx,
+        StringVal* dst) {
+    hll_union_agg_init(ctx, dst);
+}
+
+void AggregateFunctions::hll_raw_agg_update(
+        FunctionContext* ctx,
+        const StringVal& src,
+        StringVal* dst) {
+    hll_union_agg_update(ctx, src, dst);
+}
+
+void AggregateFunctions::hll_raw_agg_merge(
+        FunctionContext* ctx,
+        const StringVal& src,
+        StringVal* dst) {
+    hll_union_agg_merge(ctx, src, dst);
+}
+
+doris_udf::StringVal AggregateFunctions::hll_raw_agg_finalize(
+        doris_udf::FunctionContext* ctx,
+        const StringVal& src) {
+    DCHECK(!src.is_null);
+    DCHECK_EQ(src.len, HLL_SETS_BYTES_NUM);
+
+    StringVal result(ctx, src.len+1);
 
 Review comment:
   ```suggestion
       StringVal result(ctx, src.len + 1);
   ```

----------------------------------------------------------------
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