Converts an array of TINYINT/SMALLINT/INT/BIGINT type to a BITMAP. When the input field is illegal, the result returns NULL.
BITMAP_FROM_ARRAY(<arr>)
| Parameter | Description |
|---|---|
<arr> | integer array |
Returns a BITMAP
SELECT bitmap_to_string(bitmap_from_array(array(1, 0, 1, 1, 0, 1, 0))) AS bs;
+------+ | bs | +------+ | 0,1 | +------+
SELECT bitmap_to_string(bitmap_from_array(NULL)) AS bs;
+------+ | bs | +------+ | NULL | +------+
select bitmap_to_string(bitmap_from_array([1,2,3,-1]));
+-------------------------------------------------+ | bitmap_to_string(bitmap_from_array([1,2,3,-1])) | +-------------------------------------------------+ | NULL | +-------------------------------------------------+