BITMAP_HASH Function
Description
The BITMAP_HASH function hashes an input string and returns a bitmap containing the hash value.
Parameters
expr: An expression of type STRING.
Return Type
- Returns
BITMAP type containing an integer hash value.
Examples
- Hash a string
SELECT bitmap_to_string(bitmap_hash('hello'));
+----------------------------------------+
| bitmap_to_string(bitmap_hash('hello')) |
+----------------------------------------+
| 1321743225 |
+----------------------------------------+
- Hash another string
SELECT bitmap_to_string(bitmap_hash('world'));
+----------------------------------------+
| bitmap_to_string(bitmap_hash('world')) |
+----------------------------------------+
| 2453398188 |
+----------------------------------------+
- NULL value handling
SELECT bitmap_hash(null);
+-------------------+
| bitmap_hash(null) |
+-------------------+
| NULL |
+-------------------+