Skip to main content

MURMUR_HASH3_64_V2

Description

Computes a 64-bit MurmurHash3 hash value.

The difference from MURMUR_HASH3_64 is: this version reuses the 128-bit processing function of MurmurHash3, outputting only the first 64-bit hash value, which is consistent with the standard library implementation.

Note: According to testing, the performance of xxhash_64 is approximately 2 times that of murmur_hash3_64. Therefore, when calculating hash values, it is recommended to use xxhash_64 instead of murmur_hash3_64. If better 64-bit MurmurHash3 performance is needed, consider using murmur_hash3_64.

Syntax

MURMUR_HASH3_64_V2( <str> [ , <str> ... ] )

Parameters

ParameterDescription
<str>The value to be computed as a 64-bit MurmurHash3 hash

Return Value

Returns the 64-bit MurmurHash3 hash value of the input string.

Returns NULL if any parameter is NULL.

Examples

select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"), murmur_hash3_64_v2("hello", "world");
+--------------------------+-----------------------------+--------------------------------------+
| murmur_hash3_64_v2(null) | murmur_hash3_64_v2("hello") | murmur_hash3_64_v2("hello", "world") |
+--------------------------+-----------------------------+--------------------------------------+
| NULL | -3758069500696749310 | -662943091231200135 |
+--------------------------+-----------------------------+--------------------------------------+