Files
doris/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md
jiafeng.zhang 267e8b67c2 [refactor][doc]The new version of the document is online (#9272)
replace the `docs/` with `new-docs/`
2022-04-28 15:22:34 +08:00

2.0 KiB

title, language
title language
bitmap_from_string en

bitmap_from_string

description

Syntax

BITMAP BITMAP_FROM_STRING(VARCHAR input)

Convert a string into a bitmap. The input string should be a comma separated UNIT32. For example: input string "0, 1, 2" will be converted to a Bitmap with bit 0, 1, 2 set. If input string is invalid, return NULL.

example

mysql> select bitmap_to_string(bitmap_empty());
+----------------------------------+
| bitmap_to_string(bitmap_empty()) |
+----------------------------------+
|                                  |
+----------------------------------+

mysql> select bitmap_to_string(bitmap_from_string("0, 1, 2"));
+-------------------------------------------------+
| bitmap_to_string(bitmap_from_string('0, 1, 2')) |
+-------------------------------------------------+
| 0,1,2                                           |
+-------------------------------------------------+

mysql> select bitmap_from_string("-1, 0, 1, 2");
+-----------------------------------+
| bitmap_from_string('-1, 0, 1, 2') |
+-----------------------------------+
| NULL                              |
+-----------------------------------+

keyword

BITMAP_FROM_STRING,BITMAP