BITMAP_AND_COUNT
Descriptionβ
Computes the intersection of two or more input BITMAPs and returns the number of intersections.
Syntaxβ
BITMAP_AND_COUNT(<bitmap>, <bitmap>,[, <bitmap>...])
Parametersβ
Parameter | Description |
---|---|
<bitmap> | One of the original BITMAPs whose intersection is being sought |
Return Valueβ
Returns an integer
- If the parameter has a NULL value, it returns 0
Examplesβ
select bitmap_and_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')) as res;
+------+
| res |
+------+
| 1 |
+------+
select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5')) as res;
+------+
| res |
+------+
| 2 |
+------+
select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'),bitmap_empty()) as res;
+------+
| res |
+------+
| 0 |
+------+
select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'), NULL) as res;
+------+
| res |
+------+
| 0 |
+------+