sub_bitmap

description

Syntax

BITMAP SUB_BITMAP(BITMAP src, BIGINT offset, BIGINT cardinality_limit)

Starting from the position specified by offset, intercept cardinality_limit bitmap elements and return a bitmap subset.

example

1. mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), 0, 3)) value;
2. +-------+
3. | value |
4. +-------+
5. | 0,1,2 |
6. +-------+

8. mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), -3, 2)) value;
9. +-------+
10. | value |
11. +-------+
12. | 2,3   |
13. +-------+

15. mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), 2, 100)) value;
16. +-------+
17. | value |
18. +-------+
19. | 2,3,5 |
20. +-------+

keywords

1. SUB_BITMAP,BITMAP_SUBSET,BITMAP