Generate a Murmur Hash

Jim_KnicelyJim_Knicely Administrator, Moderator, Employee, Registered User, VerticaExpert
edited February 25 in Vertica Tips

Murmur (Murmerhash) is a modern non-cryptographic hash function having a low collision rate and high performance. It is suitable for general hash-based lookups but not suitable for cryptographic use cases.

Vertica has a built-in function called murmurhash.

Example:

dbadmin=> SELECT murmurhash('VERTICA MURMUR Hash!');
     murmurhash
---------------------
6154089896006532138
(1 row)

dbadmin=> SELECT murmurhash('The quick brown fox jumps over the lazy dog'),
dbadmin->        hash('The quick brown fox jumps over the lazy dog');
     murmurhash      |        hash
---------------------+---------------------
 6788720976440246833 | 4647120267691732726
(1 row)

Helpful Link:
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/Mathematical/HASH.htm

Have fun!

Sign In or Register to comment.