Skip to main content
Takes one or more input parameters of any data type and returns a 64-bit non-cryptographic hash value. CITY_HASH uses the CityHash algorithm for string data types, implementation-specific algorithms for other data types, and the CityHash combinator to produce the resulting hash value. If any of the inputs is NULL, the result will be NULL. See HASH if NULL values should not produce NULL.

Syntax

CITY_HASH(<expression>, [, expression [,...]])

Parameters

ParameterDescriptionSupported input types
<expression>An expression that returns any data type that Firebolt supports.Any

Return type

BIGINT

Examples

SELECT CITY_HASH('esimpson', '08-25-2016');
city_hash long
-6509667128195191394

Rows: 1Execution time: 4.96ms

SELECT CITY_HASH(NULL, '08-25-2016');
city_hash long null
NULL

Rows: 1Execution time: 4.65ms