- Categories:
Aggregate functions (Counting Distinct Values)
BITMAP_TO_ARRAY¶
Returns an ARRAY containing the positions of all bits that are set in the input bitmap.
Syntax¶
Arguments¶
bitmapA bitmap returned by the BITMAP_CONSTRUCT_AGG, BITMAP_OR_AGG, or other bitmap functions.
bucket_numberOptional. The bucket number (from BITMAP_BUCKET_NUMBER). When specified, bit positions are converted to absolute positions using the given bucket number. Defaults to 1.
Returns¶
An ARRAY of INTEGER values representing the positions of set bits.
Examples¶
See Using Bitmaps to Compute Distinct Values for Hierarchical Aggregations.