From 08065d37ed4bbbb5dab4605296fdcc6cb2eeb79a Mon Sep 17 00:00:00 2001 From: trueeyu Date: Fri, 24 Nov 2023 11:31:01 +0800 Subject: [PATCH] fix --- be/src/exprs/bitmap_functions.cpp | 5 +++-- test/sql/test_bitmap_functions/R/test_bitmap_functions | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/be/src/exprs/bitmap_functions.cpp b/be/src/exprs/bitmap_functions.cpp index 04ff9e08c2c597..c1f6aee0d78e7a 100644 --- a/be/src/exprs/bitmap_functions.cpp +++ b/be/src/exprs/bitmap_functions.cpp @@ -713,13 +713,14 @@ StatusOr BitmapFunctions::bitmap_from_binary(FunctionContext* context auto src_value = viewer.value(row); if (src_value.size == 0) { - return Status::InternalError("Invalid binary format, the size of binary is 0"); + builder.append_null(); + continue; } BitmapValue bitmap; bool res = bitmap.valid_and_deserialize(src_value.data, src_value.size); if (!res) { - return Status::InternalError("Invalid binary format, unable to deserialize the binary to bitmap"); + builder.append_null(); } else { builder.append(std::move(bitmap)); } diff --git a/test/sql/test_bitmap_functions/R/test_bitmap_functions b/test/sql/test_bitmap_functions/R/test_bitmap_functions index 855e1c1b2da72d..e3de8b99be5119 100644 --- a/test/sql/test_bitmap_functions/R/test_bitmap_functions +++ b/test/sql/test_bitmap_functions/R/test_bitmap_functions @@ -398,11 +398,11 @@ select c1, bitmap_to_string(bitmap_from_binary(bitmap_to_binary(c2))) from t1 or -- !result select bitmap_from_binary(to_binary("1234")); -- result: -E: (1064, 'Invalid binary format, unable to deserialize the binary to bitmap') +None -- !result select bitmap_from_binary(to_binary("")); -- result: -E: (1064, 'Invalid binary format, the size of binary is 0') +None -- !result select bitmap_from_binary(null); -- result: