Files
doris/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_to_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.1 KiB

title, language
title language
bitmap_to_string en

bitmap_to_string

description

Syntax

VARCHAR BITMAP_TO_STRING(BITMAP input)

Convert a input BITMAP to a string. The string is a separated string, contains all set bits in Bitmap. If input is null, return null.

example

mysql> select bitmap_to_string(null);
+------------------------+
| bitmap_to_string(NULL) |
+------------------------+
| NULL                   |
+------------------------+

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

mysql> select bitmap_to_string(to_bitmap(1));
+--------------------------------+
| bitmap_to_string(to_bitmap(1)) |
+--------------------------------+
|  1                             |
+--------------------------------+

mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2)));
+---------------------------------------------------------+
| bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2))) |
+---------------------------------------------------------+
|  1,2                                                    |
+---------------------------------------------------------+

keyword

BITMAP_TO_STRING,BITMAP