[fix](function) to_bitmap parameter parsing failure returns null instead of bitmap_empty (#21236)
* [fix](function) to_bitmap parameter parsing failure returns null instead of bitmap_empty * add ut * fix nereids * fix regression-test
This commit is contained in:
@ -27,6 +27,7 @@
|
||||
#include "testutil/any_type.h"
|
||||
#include "util/bitmap_value.h"
|
||||
#include "vec/core/types.h"
|
||||
#include "vec/data_types/data_type_bitmap.h"
|
||||
#include "vec/data_types/data_type_nullable.h"
|
||||
#include "vec/data_types/data_type_number.h"
|
||||
#include "vec/data_types/data_type_string.h"
|
||||
@ -207,4 +208,30 @@ TEST(function_bitmap_test, function_bitmap_has_all) {
|
||||
check_function<DataTypeUInt8, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
TEST(function_bitmap_test, function_to_bitmap) {
|
||||
std::string func_name = "to_bitmap";
|
||||
InputTypeSet input_types = {TypeIndex::String};
|
||||
|
||||
BitmapValue bitmap1(1);
|
||||
DataSet data_set = {{{std::string("1")}, &bitmap1},
|
||||
{{std::string("-1")}, Null()},
|
||||
{{std::string("1.11")}, Null()},
|
||||
{{Null()}, Null()}};
|
||||
|
||||
check_function<DataTypeBitMap, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
TEST(function_bitmap_test, function_bitmap_from_string) {
|
||||
std::string func_name = "bitmap_from_string";
|
||||
InputTypeSet input_types = {TypeIndex::String};
|
||||
|
||||
BitmapValue bitmap1(1);
|
||||
DataSet data_set = {{{std::string("1")}, &bitmap1},
|
||||
{{std::string("-1")}, Null()},
|
||||
{{std::string("1.11")}, Null()},
|
||||
{{Null()}, Null()}};
|
||||
|
||||
check_function<DataTypeBitMap, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
} // namespace doris::vectorized
|
||||
|
||||
Reference in New Issue
Block a user