[New Featrue] Support Vectorization Execution Engine Interface For Doris (#6329)
1. FE vectorized plan code 2. Function register vec function 3. Diff function nullable type 4. New thirdparty code and new thrift struct
This commit is contained in:
@ -29,6 +29,10 @@ using doris_udf::StringVal;
|
||||
void HllFunctions::init() {}
|
||||
|
||||
StringVal HllFunctions::hll_hash(FunctionContext* ctx, const StringVal& input) {
|
||||
return AnyValUtil::from_string_temp(ctx, hll_hash(input));
|
||||
}
|
||||
|
||||
std::string HllFunctions::hll_hash(const StringVal& input) {
|
||||
HyperLogLog hll;
|
||||
if (!input.is_null) {
|
||||
uint64_t hash_value = HashUtil::murmur_hash64A(input.ptr, input.len, HashUtil::MURMUR_SEED);
|
||||
@ -37,7 +41,8 @@ StringVal HllFunctions::hll_hash(FunctionContext* ctx, const StringVal& input) {
|
||||
std::string buf;
|
||||
buf.resize(hll.max_serialized_size());
|
||||
buf.resize(hll.serialize((uint8_t*)buf.c_str()));
|
||||
return AnyValUtil::from_string_temp(ctx, buf);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void HllFunctions::hll_init(FunctionContext*, StringVal* dst) {
|
||||
@ -45,6 +50,7 @@ void HllFunctions::hll_init(FunctionContext*, StringVal* dst) {
|
||||
dst->len = sizeof(HyperLogLog);
|
||||
dst->ptr = (uint8_t*)new HyperLogLog();
|
||||
}
|
||||
|
||||
StringVal HllFunctions::hll_empty(FunctionContext* ctx) {
|
||||
return AnyValUtil::from_string_temp(ctx, HyperLogLog::empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user