Skip to main content

BITMAP_HAS_ANY

Description​

Determines whether two Bitmaps share any common elements.

Syntax​

BITMAP_HAS_ANY(<bitmap1>, <bitmap2>)

Parameters​

ParameterDescription
<bitmap1>The first Bitmap
<bitmap2>The second Bitmap

Return Value​

Returns true if the two Bitmaps have any common elements;
Returns false if the two Bitmaps do not have any common elements.

  • If the parameter has a NULL value, it returns NULL

Examples​

select bitmap_has_any(to_bitmap(1), to_bitmap(2)) res;
+------+
| res |
+------+
| 0 |
+------+
select bitmap_has_any(bitmap_from_string('1,2,3'), to_bitmap(1)) res;
+------+
| res |
+------+
| 1 |
+------+
select bitmap_has_any(bitmap_from_string('1,2,3'), NULL) as res;
+------+
| res |
+------+
| NULL |
+------+