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 01:38:53 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_r270697930
 
 

 ##########
 File path: be/src/exprs/aggregate_functions.h
 ##########
 @@ -324,22 +324,45 @@ dst);
 
     //  HLL value type calculate
     //  init sets buffer
-    static void hll_union_agg_init(doris_udf::FunctionContext*, doris_udf::StringVal* slot);
+    static void hll_union_agg_init(doris_udf::FunctionContext*, doris_udf::HllVal* slot);
     // fill all register accroading to hll set type
-    static void hll_union_agg_update(doris_udf::FunctionContext*, const doris_udf::StringVal& src, 
-                                     doris_udf::StringVal* dst);
+    static void hll_union_agg_update(doris_udf::FunctionContext*, const doris_udf::HllVal& src,
+                                     doris_udf::HllVal* dst);
     // merge the register value
     static void hll_union_agg_merge(
                           doris_udf::FunctionContext*,
-                          const doris_udf::StringVal& src,
-                          doris_udf::StringVal* dst);
+                          const doris_udf::HllVal& src,
+                          doris_udf::HllVal* dst);
     // return result
-    static doris_udf::StringVal hll_union_agg_finalize(
+    static doris_udf::BigIntVal hll_union_agg_finalize(
                                             doris_udf::FunctionContext*,
-                                            const doris_udf::StringVal& src);
+                                            const doris_udf::HllVal& src);
     // calculate result
-    static int64_t hll_algorithm(const doris_udf::StringVal& src);
-    static void hll_union_parse_and_cal(HllSetResolver& resolver, StringVal* dst);
+    static int64_t hll_algorithm(uint8_t *pdata, int data_len);
+    static int64_t hll_algorithm(const StringVal &dst) {
+        return hll_algorithm(dst.ptr, dst.len);
+    }
+    static int64_t hll_algorithm(const HllVal &dst) {
+        return hll_algorithm(dst.ptr+1, dst.len-1);
 
 Review comment:
   ```suggestion
           return hll_algorithm(dst.ptr + 1, dst.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