This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new e9744f78459 [Bug](aggregate) fix bitmap_union return error result in 
query sql (#51866)
e9744f78459 is described below

commit e9744f78459363c0d59acb7d5aac427361c1aff8
Author: zhangstar333 <[email protected]>
AuthorDate: Fri Jun 20 19:50:19 2025 +0800

    [Bug](aggregate) fix bitmap_union return error result in query sql (#51866)
---
 be/src/vec/aggregate_functions/aggregate_function_bitmap.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h 
b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h
index b1357a7a7dc..c8894a4b623 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h
@@ -54,6 +54,7 @@ struct AggregateFunctionBitmapUnionOp {
     template <typename T>
     static void add(BitmapValue& res, const T& data, bool& is_first) {
         res.add(data);
+        is_first = false;
     }
 
     static void add(BitmapValue& res, const BitmapValue& data, bool& is_first) 
{
@@ -67,6 +68,9 @@ struct AggregateFunctionBitmapUnionOp {
 
     static void add_batch(BitmapValue& res, std::vector<const BitmapValue*>& 
data, bool& is_first) {
         res.fastunion(data);
+        // after fastunion, res myabe have many datas, so is_first should be 
false
+        // then call add function will not reset res
+        is_first = false;
     }
 
     static void merge(BitmapValue& res, const BitmapValue& data, bool& 
is_first) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to