You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/19 13:34:38 UTC

[doris] 12/36: [fix](bitmap) fix bitmap_count errors to set nullable to non-nullable bitmap col (#18689)

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

morningman pushed a commit to branch branch-2.0-alpha
in repository https://gitbox.apache.org/repos/asf/doris.git

commit b0014fb2a9ab634f27a62583ba681ecc48d84bfd
Author: luozenglin <lu...@baidu.com>
AuthorDate: Mon Apr 17 13:23:27 2023 +0800

    [fix](bitmap) fix bitmap_count errors to set nullable to non-nullable bitmap col (#18689)
---
 be/src/vec/functions/function_bitmap.cpp                       | 2 +-
 be/src/vec/functions/function_bitmap_min_or_max.h              | 2 +-
 regression-test/data/query_p0/join/test_bitmap_filter.out      | 9 +++++++++
 regression-test/suites/query_p0/join/test_bitmap_filter.groovy | 2 ++
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp
index d6cf1652db..7d340f6937 100644
--- a/be/src/vec/functions/function_bitmap.cpp
+++ b/be/src/vec/functions/function_bitmap.cpp
@@ -412,7 +412,7 @@ public:
         auto data_null_map = ColumnUInt8::create(input_rows_count, 0);
         auto& null_map = data_null_map->get_data();
 
-        auto& column = block.get_by_position(arguments[0]).column;
+        auto column = block.get_by_position(arguments[0]).column;
         if (auto* nullable = check_and_get_column<const ColumnNullable>(*column)) {
             VectorizedUtils::update_null_map(null_map, nullable->get_null_map_data());
             column = nullable->get_nested_column_ptr();
diff --git a/be/src/vec/functions/function_bitmap_min_or_max.h b/be/src/vec/functions/function_bitmap_min_or_max.h
index 788f8222a5..4f7018292d 100644
--- a/be/src/vec/functions/function_bitmap_min_or_max.h
+++ b/be/src/vec/functions/function_bitmap_min_or_max.h
@@ -56,7 +56,7 @@ public:
         auto result_column = ColumnInt64::create();
         auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0);
 
-        ColumnPtr& argument_column = block.get_by_position(arguments[0]).column;
+        ColumnPtr argument_column = block.get_by_position(arguments[0]).column;
         if (auto* nullable = check_and_get_column<ColumnNullable>(*argument_column)) {
             // Danger: Here must dispose the null map data first! Because
             // argument_columns[i]=nullable->get_nested_column_ptr(); will release the mem
diff --git a/regression-test/data/query_p0/join/test_bitmap_filter.out b/regression-test/data/query_p0/join/test_bitmap_filter.out
index 1ad7849124..925421cbe2 100644
--- a/regression-test/data/query_p0/join/test_bitmap_filter.out
+++ b/regression-test/data/query_p0/join/test_bitmap_filter.out
@@ -138,3 +138,12 @@
 14	255
 15	1992
 
+-- !sql19 --
+1
+3
+5
+7
+9
+11
+13
+
diff --git a/regression-test/suites/query_p0/join/test_bitmap_filter.groovy b/regression-test/suites/query_p0/join/test_bitmap_filter.groovy
index fe18451978..d6286e91bd 100644
--- a/regression-test/suites/query_p0/join/test_bitmap_filter.groovy
+++ b/regression-test/suites/query_p0/join/test_bitmap_filter.groovy
@@ -77,6 +77,8 @@ suite("test_bitmap_filter", "query_p0") {
 
     qt_sql18 "select k1, k2 from ${tbl1} t where 100 not in (select k2 from ${tbl2}) order by 1, 2;"
 
+    qt_sql19 "select k1 from ${tbl1} t where k1 in (select k2 from ${tbl2} where bitmap_count(k2) > 6) order by 1;"
+
     test {
         sql "select k1, k2 from ${tbl1} b1 where k1 in (select k2 from ${tbl2} b2 where b1.k2 = b2.k1) order by k1;"
         exception "In bitmap does not support correlated subquery"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org