BITMAP_TO_ARRAY

functionsupportedCore SQL functions

docs.snowflake.com ↗

Aggregate functions

Returns an ARRAY containing the positions of all bits that are set in the input bitmap.

Syntax

supportedpartialnot supportednot scored

BITMAP_TO_ARRAY( <bitmap> [, <bucket_number> ] )

Parameters

NameRequiredDescription
bitmaprequiredA bitmap returned by the BITMAP_CONSTRUCT_AGG, BITMAP_OR_AGG, or other bitmap functions.
bucket_numberrequiredOptional. 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.

See also