[refactor](vectorized) to_bitmap(-1) return NULL instead of return parse failed error_message (#8373)

This commit is contained in:
zhangstar333
2022-03-11 17:21:47 +08:00
committed by GitHub
parent e403dbc38c
commit e0ef9b8f6c
22 changed files with 425 additions and 170 deletions

View File

@ -86,24 +86,19 @@ TEST_F(BitmapFunctionsTest, to_bitmap_null) {
StringVal input = StringVal::null();
StringVal result = BitmapFunctions::to_bitmap(ctx, input);
BitmapValue bitmap;
StringVal expected = convert_bitmap_to_string(ctx, bitmap);
ASSERT_EQ(expected, result);
ASSERT_EQ(StringVal::null(), result);
}
TEST_F(BitmapFunctionsTest, to_bitmap_invalid_argument) {
StringVal input = AnyValUtil::from_string_temp(ctx, std::string("-1"));
StringVal result = BitmapFunctions::to_bitmap(ctx, input);
ASSERT_EQ(StringVal::null(), result);
ASSERT_TRUE(ctx->has_error());
}
TEST_F(BitmapFunctionsTest, to_bitmap_out_of_range) {
StringVal input = AnyValUtil::from_string_temp(ctx, std::string("18446744073709551616"));
StringVal result = BitmapFunctions::to_bitmap(ctx, input);
ASSERT_EQ(StringVal::null(), result);
ASSERT_TRUE(ctx->has_error());
}
TEST_F(BitmapFunctionsTest, bitmap_union_int) {