From b5fa29e13845075e270df13504422ac5adb6d2ba Mon Sep 17 00:00:00 2001 From: Jerry Hu Date: Thu, 27 Jul 2023 22:44:06 +0800 Subject: [PATCH] [fix](bitmap) incorrect result of function 'bitmap_from_array' (#22305) --- be/src/vec/functions/function_bitmap.cpp | 2 +- .../sql_functions/array_functions/test_array_functions.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp index 8d252f77f2..578ce0e34d 100644 --- a/be/src/vec/functions/function_bitmap.cpp +++ b/be/src/vec/functions/function_bitmap.cpp @@ -279,8 +279,8 @@ struct BitmapFromArray { //input is valid value if (!null_map[i]) { res.emplace_back(bits); - bits.clear(); } + bits.clear(); } return Status::OK(); } diff --git a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out index 277cc4e883..ca027aaf71 100644 --- a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out +++ b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out @@ -1697,7 +1697,7 @@ [1, 2, 3, 4, 5, 4, 3, 2, 1] 1,2,3,4,5 [8, 9, NULL, 10, NULL] \N [1, 2, 3, 3, 4, 4, NULL] \N -[1, 2, 3] 1,2,3,4,8,9 +[1, 2, 3] 1,2,3 -- !select_union -- 10005 [10005, NULL, NULL] [10005, NULL, 1, 2, 3]