GROUP_BITMAP_STATE Function
Description
The GROUP_BITMAP_STATE function builds a BITMAP type result based on the input expression (expr). This function is typically used for grouping operations on integer type data and converting the unique values of each group into a bitmap array.
Parameter Description
expr: The integer type expression to be processed.
Return Type
- Returns a
BITMAPtype result.
Usage Examples
Example 1: Build Bitmap by group and view elements
In this example, group a contains two unique values 1 and 2, and group b contains only the unique value 3.
Example 2: Two-stage aggregation with group_bitmap_merge
First use group_bitmap_state to generate intermediate state by group, then use group_bitmap_merge to merge all groups and obtain the global cardinality:
