bitmap_hash64
Calculates a 64-bit hash value for any type of input and returns a bitmap containing the hash value. It is mainly used to load non-integer data into the BITMAP field of the StarRocks table via Stream Load. For example:
cat data | curl --location-trusted -u user:passwd -T - \
-H "columns: dt,page,device_id, device_id=bitmap_hash64(device_id)" \
http://<fe_host>:8030/api/test_db/tbl1/_stream_load
Syntaxβ
BITMAP BITMAP_HASH64(expr)
Parametersβ
expr
: The input can be of any data type.
Return valueβ
Returns a value of the BITMAP data type.
Examplesβ
MySQL > select bitmap_count(bitmap_hash64('hello'));
+--------------------------------------+
| bitmap_count(bitmap_hash64('hello')) |
+--------------------------------------+
| 1 |
+--------------------------------------+
select bitmap_to_string(bitmap_hash64('hello'));
+------------------------------------------+
| bitmap_to_string(bitmap_hash64('hello')) |
+------------------------------------------+
| 10760762337991515389 |
+------------------------------------------+
keywordβ
BITMAP_HASH64,BITMAP