Skip to main content

Categories: Conversion

HASH

Returns a 32-bit hash of the input value. Returns 0 for NULL input. HASH32 is an alias for HASH.

Syntax​

HASH(expression any) → integer​

  • expression: Value of any Dremio-supported data type.

Examples

HASH example
SELECT HASH(host_id)
FROM "Samples"."samples.dremio.com"."Dremio University"."airbnb_listings.csv"
LIMIT 5
-- 1110609030
-- 1283762365
-- -1745730253
-- 0
-- 0
Hash a string with a non-ASCII character
SELECT HASH('Drémio')
-- 1973709410
Hash values of different data types
SELECT HASH(1), HASH(1.5), HASH(TRUE), HASH(DATE '2026-03-18')
-- -142385009, -2002824248, -142385009, 499655135
Hash a NULL value
SELECT HASH(NULL)
-- 0

Usage Notes​

HASH is a proprietary function that can accept different input expressions of arbitrary Dremio supported data types and returns a signed value. It is not a cryptographic hash function and should not be used as such.