This is an automated email from the ASF dual-hosted git repository.
gaodayue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new b62b310 [Bug] Fix BE crash when input to hll_merge is null (#3521)
b62b310 is described below
commit b62b3108641cc5cd03dd439115dbc798cd7d6c60
Author: Dayue Gao <[email protected]>
AuthorDate: Sat May 9 11:01:48 2020 +0800
[Bug] Fix BE crash when input to hll_merge is null (#3521)
---
be/src/exprs/hll_function.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/be/src/exprs/hll_function.cpp b/be/src/exprs/hll_function.cpp
index e18f177..849cf69 100644
--- a/be/src/exprs/hll_function.cpp
+++ b/be/src/exprs/hll_function.cpp
@@ -64,6 +64,9 @@ void HllFunctions::hll_update(FunctionContext *, const T
&src, StringVal* dst) {
}
void HllFunctions::hll_merge(FunctionContext*, const StringVal& src,
StringVal* dst) {
+ if (src.is_null) {
+ return;
+ }
auto* dst_hll = reinterpret_cast<HyperLogLog*>(dst->ptr);
// zero size means the src input is a agg object
if (src.len == 0) {
@@ -81,6 +84,9 @@ BigIntVal HllFunctions::hll_finalize(FunctionContext*, const
StringVal &src) {
}
BigIntVal HllFunctions::hll_get_value(FunctionContext*, const StringVal &src) {
+ if (src.is_null) {
+ return BigIntVal::null();
+ }
auto* src_hll = reinterpret_cast<HyperLogLog*>(src.ptr);
BigIntVal result(src_hll->estimate_cardinality());
return result;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]