BITMAP_FROM_STRING
Descriptionβ
Convert a string into a BITMAP. The string consists of a group of unsigned bigint numbers separated by commas. (The number values are between: 0 ~ 18446744073709551615) For example, the string "0, 1, 2" will be converted into a Bitmap, where the 0th, 1st, and 2nd bits are set. When the input field is invalid, NULL is returned
Syntaxβ
BITMAP_FROM_STRING(<str>)
Parametersβ
Parameter | Description |
---|---|
<str> | Array string, for example "0, 1, 2" string will be converted to a Bitmap with bits 0, 1, 2 set |
Return Valueβ
Returns a BITMAP
- When the input field is invalid, the result is NULL
Examplesβ
select bitmap_to_string(bitmap_from_string("0, 1, 2")) bts;
+-------+
| bts |
+-------+
| 0,1,2 |
+-------+
select bitmap_from_string("-1, 0, 1, 2") bfs;
+------+
| bfs |
+------+
| NULL |
+------+
select bitmap_to_string(bitmap_from_string("0, 1, 18446744073709551615")) bts;
+--------------------------+
| bts |
+--------------------------+
| 0,1,18446744073709551615 |
+--------------------------+