Support bitmap_empty function (#2227)

This commit is contained in:
kangkaisen
2019-11-18 20:37:00 +08:00
committed by ZHAO Chun
parent 626001fae4
commit d8cfbbedf7
12 changed files with 67 additions and 35 deletions

View File

@ -30,6 +30,14 @@ void BitmapFunctions::bitmap_init(FunctionContext* ctx, StringVal* dst) {
dst->ptr = (uint8_t*)new RoaringBitmap();
}
StringVal BitmapFunctions::bitmap_empty(FunctionContext* ctx) {
RoaringBitmap bitmap;
std::string buf;
buf.resize(bitmap.size());
bitmap.serialize((char*)buf.c_str());
return AnyValUtil::from_string_temp(ctx, buf);
}
template <typename T>
void BitmapFunctions::bitmap_update_int(FunctionContext* ctx, const T& src, StringVal* dst) {
if (src.is_null) {