BITMAP_HAS_ALL
Descriptionβ
Determines whether one Bitmap contains all the elements of another Bitmap.
Syntaxβ
BITMAP_HAS_ALL(<bitmap1>, <bitmap2>)
Parametersβ
Parameter | Description |
---|---|
<bitmap1> | The first Bitmap |
<bitmap2> | The second Bitmap |
Return Valueβ
Returns true
if <bitmap1>
contains all the elements of <bitmap2>
;
Returns true
if <bitmap2>
contains no elements;
Otherwise, returns false
.
- If the parameter has a NULL value, it returns NULL
Examplesβ
To check if one Bitmap contains all elements of another Bitmap:
select bitmap_has_all(bitmap_from_string('0, 1, 2'), bitmap_from_string('1, 2')) as res;
The result will be:
+------+
| res |
+------+
| 1 |
+------+
To check if an empty Bitmap contains all elements of another Bitmap:
select bitmap_has_all(bitmap_empty(), bitmap_from_string('1, 2')) as res;
The result will be:
+------+
| res |
+------+
| 0 |
+------+
select bitmap_has_all(bitmap_empty(), NULL) as res;
The result will be:
+------+
| res |
+------+
| NULL |
+------+