This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new 706c808da1 [fix](bitmap) fix coredump of bitmap_from_array caused by
null array literal (#24423)
706c808da1 is described below
commit 706c808da1b9b35713dab902c9b49f0981127496
Author: TengJianPing <[email protected]>
AuthorDate: Fri Sep 15 17:26:07 2023 +0800
[fix](bitmap) fix coredump of bitmap_from_array caused by null array
literal (#24423)
---
be/src/vec/functions/function_bitmap.cpp | 7 +++++++
.../sql_functions/bitmap_functions/test_bitmap_function.out | 3 +++
.../sql_functions/bitmap_functions/test_bitmap_function.groovy | 3 +++
3 files changed, 13 insertions(+)
diff --git a/be/src/vec/functions/function_bitmap.cpp
b/be/src/vec/functions/function_bitmap.cpp
index 9296fb9c10..f1570628e6 100644
--- a/be/src/vec/functions/function_bitmap.cpp
+++ b/be/src/vec/functions/function_bitmap.cpp
@@ -292,6 +292,9 @@ public:
if (check_column<ColumnInt8>(nested_column)) {
Impl::template vector<ColumnInt8>(offset_column_data,
nested_column,
nested_null_map, res,
null_map);
+ } else if (check_column<ColumnUInt8>(nested_column)) {
+ Impl::template vector<ColumnInt8>(offset_column_data,
nested_column,
+ nested_null_map, res,
null_map);
} else if (check_column<ColumnInt16>(nested_column)) {
Impl::template vector<ColumnInt16>(offset_column_data,
nested_column,
nested_null_map, res,
null_map);
@@ -301,6 +304,10 @@ public:
} else if (check_column<ColumnInt64>(nested_column)) {
Impl::template vector<ColumnInt64>(offset_column_data,
nested_column,
nested_null_map, res,
null_map);
+ } else {
+ return Status::RuntimeError("Illegal column {} of argument of
function {}",
+
block.get_by_position(arguments[0]).column->get_name(),
+ get_name());
}
} else {
return Status::RuntimeError("Illegal column {} of argument of
function {}",
diff --git
a/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out
b/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out
index acfc638330..501c15350c 100644
---
a/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out
+++
b/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out
@@ -510,3 +510,6 @@ true
-- !sql_orthogonal_bitmap_intersect_count --
1 1
+-- !sql --
+
+
diff --git
a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
index 92c1e435eb..2f01f183e7 100644
---
a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
+++
b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
@@ -762,4 +762,7 @@ suite("test_bitmap_function") {
select count(distinct tag) as count1,
orthogonal_bitmap_intersect_count(id_bitmap, tag, 0) as
count2_bitmap from test_orthog_bitmap_intersect;
"""
+
+ // BITMAP_FROM_ARRAY
+ qt_sql """ select bitmap_to_string(BITMAP_FROM_ARRAY([]));"""
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]