BITMAP_TO_RB32 Function
Overview
The BITMAP_TO_RB32 function converts a Singdata internal BITMAP type to binary data in the standard Roaring Bitmap 32-bit serialization format. This function is primarily used for data export and interoperability with external systems (such as ClickHouse, Druid, and other systems using the standard Roaring Bitmap format).
Syntax
bitmap_to_rb32(expr)
Parameters
expr: An expression of typeBITMAP, containing Singdata internal BITMAP data.
Return Result
Returns BINARY type, with content being binary data in the Roaring Bitmap 32-bit serialization format. Returns NULL if the input is NULL.
Examples
-
Round-trip conversion between BITMAP and Roaring Bitmap 32-bit format using
rb32_to_bitmap: -
View the converted binary data using
base64encoding: -
Returns NULL when the input is NULL:
Notes
- When the input parameter is NULL, the result is NULL.
- The Roaring Bitmap 32-bit format only supports values within the 32-bit unsigned integer range (0 ~ 4294967295). If the Singdata BITMAP contains values beyond this range, consider using
bitmap_to_rb64for 64-bit format conversion. - The inverse operation of this function is
rb32_to_bitmap, which converts binary data in Roaring Bitmap 32-bit serialization format to a Singdata BITMAP.
