Skip to main content

BITMAP_MIN

Description

Computes and returns the minimum value in a Bitmap.

Syntax

BITMAP_MIN(<bitmap>)

Parameters

ParameterDescription
<bitmap>A Bitmap type column or expression

Return Value

The minimum value in the Bitmap.
Returns NULL if the Bitmap is empty or is NULL value.

Examples

To compute the minimum value in an empty Bitmap:

select bitmap_min(bitmap_from_string('')) value;

The result will be:

+-------+
| value |
+-------+
| NULL |
+-------+

To compute the minimum value in a Bitmap with multiple elements:

select bitmap_min(bitmap_from_string('1,9999999999')) value;

The result will be:

+-------+
| value |
+-------+
| 1 |
+-------+
select bitmap_min(bitmap_empty()) res1,bitmap_min(NULL) res2;

The result will be:

+------+------+
| res1 | res2 |
+------+------+
| NULL | NULL |
+------+------+