MurmurHash3 functions in the Hashfuncs DuckDB extension
Function category
MurmurHash3
3 functionsAustin Appleby's MurmurHash3 — a battle-tested non-cryptographic hash widely used in distributed systems including Apache Cassandra, Apache Spark, and many partitioner implementations. Choose murmurhash3_32, murmurhash3_128, or murmurhash3_x64_128 when you need to interoperate with an existing MurmurHash3-based consumer.
Signature
2 overloaded forms · click to inspectArguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
value
|
Type
ANY
|
Mode Positional | Description |
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
value
|
Type
ANY
|
Mode Positional | Description |
Argument
seed
|
Type
UINTEGER
|
Mode Positional | Description |
Description
128-bit MurmurHash3 — the x86 variant. Returns a UHUGEINT covering both 64-bit halves of the hash.
Included for compatibility with consumers that specifically expect the x86 128-bit form. On modern 64-bit hardware, murmurhash3_x64_128 is generally the right pick.
SELECT murmurhash3_128('hello world');
Output
| murmurhash3_128('hello world') |
|---|
| 206095855024402301784664199839047883400 |
SELECT murmurhash3_128('hello world', 42);
Output
| murmurhash3_128('hello world', 42) |
|---|
| 49935197742640446573784908445156827108 |
Signature
2 overloaded forms · click to inspectArguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
value
|
Type
ANY
|
Mode Positional | Description |
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
value
|
Type
ANY
|
Mode Positional | Description |
Argument
seed
|
Type
UINTEGER
|
Mode Positional | Description |
Description
32-bit MurmurHash3. Battle-tested across distributed systems — variants of MurmurHash3 underpin hash partitioning in Apache Cassandra, Apache Spark, and many other tools.
Choose murmurhash3_32 when you need cross-system compatibility with an existing MurmurHash3-32 consumer. For new in-DuckDB workloads, xxh3_64 is generally faster.
SELECT murmurhash3_32('hello world');
Output
| murmurhash3_32('hello world') |
|---|
| 1586663183 |
SELECT murmurhash3_32('hello world', 123);
Output
| murmurhash3_32('hello world', 123) |
|---|
| 679062093 |
Signature
2 overloaded forms · click to inspectArguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
value
|
Type
ANY
|
Mode Positional | Description |
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
value
|
Type
ANY
|
Mode Positional | Description |
Argument
seed
|
Type
UINTEGER
|
Mode Positional | Description |
Description
128-bit MurmurHash3 — the x64 variant. The standard 128-bit MurmurHash3 form on 64-bit platforms; this is what most modern consumers (including Apache Cassandra's Murmur3Partitioner and Apache Spark's default hash partitioner) actually use.
Returned as a UHUGEINT. Use this when DuckDB needs to produce hashes that match what another system has already computed for the same key.
SELECT murmurhash3_x64_128('hello world');
Output
| murmurhash3_x64_128('hello world') |
|---|
| 228083453807047072434243676435732455694 |
SELECT murmurhash3_x64_128('hello world', 42);
Output
| murmurhash3_x64_128('hello world', 42) |
|---|
| 177772143293161058141827116100740741312 |