RB64_TO_BITMAP Function
Overview
The RB64_TO_BITMAP function converts binary data in the standard Roaring Bitmap 64-bit serialization format to a Singdata internal BITMAP type. This function is primarily used for data interoperability with external systems, supports the full value range of Singdata BITMAP, and is suitable for scenarios involving values beyond the 32-bit unsigned integer range.
Syntax
rb64_to_bitmap(expr)
Parameters
expr: An expression of typeBINARY, containing binary data in the Roaring Bitmap 64-bit serialization format.
Return Result
Returns BITMAP type. Returns NULL if the input data is not in valid Roaring Bitmap 64-bit format.
Examples
-
Round-trip conversion between BITMAP and Roaring Bitmap 64-bit format using
bitmap_to_rb64: -
Round-trip conversion for values beyond the 32-bit range (greater than 4294967295):
-
Analyze the conversion result using bitmap functions:
Notes
- When the input parameter is NULL, the result is NULL.
- When the input binary data is not in valid Roaring Bitmap 64-bit serialization format, the function returns NULL instead of throwing an error.
- 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 interoperability scenarios involving values beyond the 32-bit range, the 64-bit format (
rb64_to_bitmap/bitmap_to_rb64) should be preferred. - The inverse operation of this function is
bitmap_to_rb64, which converts a Singdata BITMAP to the Roaring Bitmap 64-bit serialization format.
