Avoid SerDe for aggregation query with object pool (#1854)

This commit is contained in:
kangkaisen
2019-09-26 13:51:13 +08:00
committed by Mingyu Chen
parent 7df1418ff4
commit b246d93128
28 changed files with 194 additions and 114 deletions

View File

@ -64,10 +64,15 @@ void HllFunctions::hll_update(FunctionContext *, const T &src, StringVal* dst) {
dst_hll->update(hash_value);
}
}
void HllFunctions::hll_merge(FunctionContext*, const StringVal &src, StringVal* dst) {
HyperLogLog src_hll((uint8_t*)src.ptr);
auto* dst_hll = reinterpret_cast<HyperLogLog*>(dst->ptr);
dst_hll->merge(src_hll);
// zero size means the src input is a agg object
if (src.len == 0) {
dst_hll->merge(*reinterpret_cast<HyperLogLog*>(src.ptr));
} else {
dst_hll->merge(HyperLogLog(src.ptr));
}
}
BigIntVal HllFunctions::hll_finalize(FunctionContext*, const StringVal &src) {