[fix](ut) fix some UT compile or run failed cases (#8489)

This commit is contained in:
camby
2022-03-16 11:38:35 +08:00
committed by GitHub
parent 2252ff81d7
commit 3ba4de0d27
4 changed files with 16 additions and 8 deletions

View File

@ -156,9 +156,16 @@ void read_from(const char** src, StringValue* result) {
} // namespace detail
static StringVal serialize(FunctionContext* ctx, BitmapValue* value) {
StringVal result(ctx, value->getSizeInBytes());
value->write((char*)result.ptr);
return result;
if (!value) {
BitmapValue empty_bitmap;
StringVal result(ctx, empty_bitmap.getSizeInBytes());
empty_bitmap.write((char*)result.ptr);
return result;
} else {
StringVal result(ctx, value->getSizeInBytes());
value->write((char*)result.ptr);
return result;
}
}
// Calculate the intersection of two or more bitmaps
@ -1248,4 +1255,4 @@ template StringVal BitmapFunctions::orthogonal_bitmap_intersect_count_serialize<
FunctionContext* ctx, const StringVal& src);
template StringVal BitmapFunctions::orthogonal_bitmap_intersect_count_serialize<StringValue>(
FunctionContext* ctx, const StringVal& src);
} // namespace doris
} // namespace doris