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_r270697917
##########
File path: be/src/udf/udf.h
##########
@@ -762,6 +766,39 @@ struct LargeIntVal : public AnyVal {
}
};
+struct HllVal : public StringVal {
+
+ HllVal() : StringVal() { }
+
+ void init(FunctionContext* ctx) {
+ len = doris::HLL_COLUMN_DEFAULT_LEN;
+ is_null = false;
+ ptr = ctx->allocate(len);
+ memset(ptr, 0, len);
+ // the HLL type is HLL_DATA_FULL in UDF or UDAF
+ ptr[0] = doris::HllDataType::HLL_DATA_FULL;
+ }
+
+ doris::HllDataType getHllType() {
+ DCHECK(!is_null);
+
+ return (doris::HllDataType)(ptr[0]);
+ }
+
+ uint8_t &getHllData(int idx) const {
Review comment:
Don't return a reference value, you can add a function named `setHllData`
----------------------------------------------------------------
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]