Skip to main content
Converts Bitmap values to a Binary string. bitmap_to_binary is mainly used for exporting Bitmap data. The compression effect is better than bitmap_to_base64. If you plan to export data directly to a binary file such as Parquet, this function is recommended. This function is supported from v3.0.

Syntax

Parameters

bitmap: the Bitmap to convert, required. If the input value is invalid, an error is returned.

Return value

Returns a value of the VARBINARY type.

Examples

Example 1: Use this function with other bitmap functions.
Example 2: Convert each value in a BITMAP column into a binary string.
  1. Create an Aggregate table page_uv where the AGGREGATE KEY is (page_id, visit_date). This table contains a BITMAP column visit_users whose values are to be aggregated.
  2. Insert data into this table.
  3. Convert each value in the visit_users column into a binary-encoded string.