Files
doris/docs/en/sql-reference/sql-functions/bitmap-functions/bitmap_xor.md
lihuigang 05ac7fcd4a [Function] Add BE udf bitmap_xor (#5098)
this function will return the xor result of inputs two bitmap .
2021-01-04 09:27:46 +08:00

1.7 KiB

title, language
title language
bitmap_xor en

bitmap_xor

description

Syntax

BITMAP BITMAP_XOR(BITMAP lhs, BITMAP rhs)

Compute the symmetric union of two input bitmaps, return the new bitmap.

example

mysql> select bitmap_count(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt;
+------+
| cnt  |
+------+
|    2 |
+------+

mysql> select bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4')));
+----------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'), bitmap_from_string('1,2,3,4'))) |
+----------------------------------------------------------------------------------------+
| 1,4                                                                                    |
+----------------------------------------------------------------------------------------+

keyword

BITMAP_XOR,BITMAP