Skip to main content
unnest_bitmap is a table function that takes a bitmap and converts elements in that bitmap into multiple rows of a table. The database’ Lateral Join can be used in conjunction with the unnest_bitmap function to implement common column-to-row logic. This function can be used to replace unnest(bitmap_to_array(bitmap)). It has better performance, takes up less memory resources, and is not limited by the length of the array. This function is supported from v3.1.

Syntax

Parameters

bitmap: the bitmap you want to convert.

Return value

Returns multiple rows converted from the bitmap. The type of return value is BIGINT.

Examples

c2 is a bitmap column in table t1.