Files
doris/docs/documentation/cn/sql-reference/sql-functions/bitmap-functions/to_bitmap.md
Dayue Gao ccaa97a5ac Make bitmap functions accept any expression that returns bitmap (#2728)
This CL make bitmap_count, bitmap_union, and bitmap_union_count accept any expression whose return type is bitmap as input so that we can support flexible bitmap expression such as bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(2))).

This CL also create separate documentation for each bitmap UDF to conform with other functions.
2020-01-11 14:02:12 +08:00

1.4 KiB

to_bitmap

description

Syntax

BITMAP TO_BITMAP(expr)

输入为取值在 0 ~ 4294967295 区间的 unsigned int ,输出为包含该元素的bitmap。 该函数主要用于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 |
+-----------------------------+

keyword

TO_BITMAP,BITMAP