HASH
HASH(x, digest)
Computes the hash of the bytes
value x
using digest
, where digest
is one of the OpenSSL digest methods md5
, sha1
, sha256
, or sha512
(case insensitive).
SELECT HASH('foo', 'md5')
SELECT HASH('foo', 'sha1')
SELECT HASH('foo', 'sha256')
SELECT HASH('foo', 'sha512')
HASH_COMBINE
HASH_COMBINE(x, ...)
Computes a unique hash over all input arguments. Order matters for the input arguments, and all types are supported, though any null argument results in a null return value.
SELECT HASH_COMBINE(1, 'foo', true)
SELECT HASH_COMBINE('foo', null)
ID_HASH
ID_HASH(x, ...)
Equivalent of TO_BASE64(HASH_COMBINE(args...))
. Useful when constructing a custom value for _id
in an ingest transformation, e.g. SELECT ID_HASH(field1, field2) AS _id
.
SELECT ID_HASH('foo', 35)
MD5
MD5(x)
Computes the MD5 hash of the bytes
value x
.
SELECT MD5('foo')
SELECT MD5('')
SELECT MD5(null)
SHA1
SHA1(x)
Computes the SHA1 hash of the bytes
value x
.
SELECT SHA1('foo')
SELECT SHA1('')
SELECT SHA1(null)
SHA256
SHA256(x)
Computes the SHA256 hash of the bytes
value x
.
SELECT SHA256('foo')
SELECT SHA256('')
SELECT SHA256(null)
SHA512
SHA512(x)
Computes the SHA512 hash of the bytes
value x
.
SELECT SHA512('foo')
SELECT SHA512('')
SELECT SHA512(null)
XXH3_64
XXH3_64(x[, seed])
Computes the 64 bit XXH3 hash of x
using seed
as the seed. seed
is optional, default value is 0.
SELECT XXH3_64('foo', 1122)
SELECT XXH3_64('', 1122)
SELECT XXH3_64(null, 1122)