Skip to main content

Categories: Conversion

HASH64

Returns a 64-bit hash of the input value, with optional seed. Returns 0 for NULL input.

Syntax​

HASH64(value ANY [, seed BIGINT]) → BIGINT​

  • value: Value of any Dremio-supported data type.
  • seed (optional): Optional seed for hash calculation.

Examples

HASH64 example
SELECT HASH64('abc')
-- -5434086359492102041
HASH64 example
SELECT HASH64(5.127)
-- -1149762993205326574
HASH64 example
SELECT HASH64(null)
-- 0
HASH64 example
SELECT HASH64('abc',123)
-- 1489494923063836066
Compute a 64-bit hash of a string with a non-ASCII character
SELECT HASH64('Drémio')
-- 8012473891516711073
Compute a 64-bit hash of an integer
SELECT HASH64(1)
-- 4308238529031811090