BITMAP_TO_RB64 Function
Overview
The BITMAP_TO_RB64 function converts a Singdata internal BITMAP type to binary data in the standard Roaring Bitmap 64-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). Unlike bitmap_to_rb32, this function supports the full value range of Singdata BITMAP and is not limited by the 32-bit unsigned integer range.
Syntax
bitmap_to_rb64(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 64-bit serialization format.
Examples
-
Round-trip conversion between BITMAP and Roaring Bitmap 64-bit format using
rb64_to_bitmap: -
Supports values beyond the 32-bit range (greater than 4294967295), which is a key advantage of
bitmap_to_rb64overbitmap_to_rb32: -
View the converted binary data using
base64encoding:
Notes
- When the input parameter is NULL, the result is NULL.
- The Roaring Bitmap 64-bit format supports the full value range of Singdata BITMAP and is not limited by the 32-bit unsigned integer range (0 ~ 4294967295). For BITMAP data export scenarios involving values beyond the 32-bit range,
bitmap_to_rb64should be preferred overbitmap_to_rb32. - The inverse operation of this function is
rb64_to_bitmap, which converts binary data in Roaring Bitmap 64-bit serialization format to a Singdata BITMAP.
