Skip to content

Commit 7db692f

Browse files
authored
branch-3.1: [Bug](aggregate) fix bitmap_union return error result in query sql #52033 (#53000)
cherry-pick from master #52033
1 parent 690f199 commit 7db692f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

be/src/vec/aggregate_functions/aggregate_function_bitmap.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ struct AggregateFunctionBitmapUnionOp {
5454
template <typename T>
5555
static void add(BitmapValue& res, const T& data, bool& is_first) {
5656
res.add(data);
57+
is_first = false;
5758
}
5859

5960
static void add(BitmapValue& res, const BitmapValue& data, bool& is_first) {
@@ -67,6 +68,9 @@ struct AggregateFunctionBitmapUnionOp {
6768

6869
static void add_batch(BitmapValue& res, std::vector<const BitmapValue*>& data, bool& is_first) {
6970
res.fastunion(data);
71+
// after fastunion, res myabe have many datas, so is_first should be false
72+
// then call add function will not reset res
73+
is_first = false;
7074
}
7175

7276
static void merge(BitmapValue& res, const BitmapValue& data, bool& is_first) {

0 commit comments

Comments
 (0)