to_bitmap
to_bitmap
description
Syntax
BITMAP TO_BITMAP(expr)
输入为取值在 0 ~ 18446744073709551615 区间的 unsigned bigint ,输出为包含该元素的bitmap。 当输入值不在此范围时, 会返回NULL。 该函数主要用于stream load任务将整型字段导入Doris表的bitmap字段。例如
cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,user_id, user_id=to_bitmap(user_id)" http://host:8410/api/test/testDb/_stream_load
example
mysql> select bitmap_count(to_bitmap(10));
+-----------------------------+
| bitmap_count(to_bitmap(10)) |
+-----------------------------+
| 1 |
+-----------------------------+
MySQL> select bitmap_to_string(to_bitmap(-1));
+---------------------------------+
| bitmap_to_string(to_bitmap(-1)) |
+---------------------------------+
| |
+---------------------------------+
keywords
TO_BITMAP,BITMAP