Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Hash functions
Hash functions can be used for the deterministic pseudo-random shuffling of elements. Simhash is a hash function, which returns close hash values for close (similar) arguments. Most hash functions accept any number of arguments of any types.Hash of NULL is NULL. To get a non-NULL hash of a Nullable column, wrap it in a tuple:
To calculate hash of the whole contents of a table, use
sum(cityHash64(tuple(*))) (or other hash function). tuple ensures that rows with NULL values are not skipped. sum ensures that the order of rows doesn’t matter.BLAKE3
Introduced in: v22.10.0 Calculates BLAKE3 hash string and returns the resulting set of bytes as FixedString. This cryptographic hash-function is integrated into ClickHouse with BLAKE3 Rust library. The function is rather fast and shows approximately two times faster performance compared to SHA-2, while generating hashes of the same length as SHA-256. It returns a BLAKE3 hash as a byte array with type FixedString(32). Syntaxmessage— The input string to hash.String
FixedString(32)
Examples
hash
Query
Response
MD4
Introduced in: v21.11.0 Calculates the MD4 hash of the given string. Syntaxs— The input string to hash.String
FixedString(16)
Examples
Usage example
Query
Response
MD5
Introduced in: v1.1.0 Calculates the MD5 hash of the given string. Syntaxs— The input string to hash.String
FixedString(16)
Examples
Usage example
Query
Response
RIPEMD160
Introduced in: v24.10.0 Calculates the RIPEMD-160 hash of the given string. Syntaxs— The input string to hash.String
FixedString(20)
Examples
Usage example
Query
Response
SHA1
Introduced in: v1.1.0 Calculates the SHA1 hash of the given string. Syntaxs— The input string to hashString
FixedString(20)
Examples
Usage example
Query
Response
SHA224
Introduced in: v1.1.0 Calculates the SHA224 hash of the given string. Syntaxs— The input value to hash.String
FixedString(28)
Examples
Usage example
Query
Response
SHA256
Introduced in: v1.1.0 Calculates the SHA256 hash of the given string. Syntaxs— The input string to hash.String
FixedString(32)
Examples
Usage example
Query
Response
SHA384
Introduced in: v1.1.0 Calculates the SHA384 hash of the given string. Syntaxs— The input string to hash.String
FixedString(48)
Examples
Usage example
Query
Response
SHA512
Introduced in: v1.1.0 Calculates the SHA512 hash of the given string. Syntaxs— The input string to hashString
FixedString(64)
Examples
Usage example
Query
Response
SHA512_256
Introduced in: v1.1.0 Calculates the SHA512_256 hash of the given string. Syntaxs— The input string to hash.String
FixedString(32)
Examples
Usage example
Query
Response
URLHash
Introduced in: v1.1.0 A fast, decent-quality non-cryptographic hash function for a string obtained from a URL using some type of normalization. This hash function has two modes:| Mode | Description |
|---|---|
URLHash(url) | Calculates a hash from a string without one of the trailing symbols /,? or # at the end, if present. |
URLHash(url, N) | Calculates a hash from a string up to the N level in the URL hierarchy, without one of the trailing symbols /,? or # at the end, if present. Levels are the same as in URLHierarchy. |
url. UInt64
Examples
Usage example
Query
Response
Query
Response
cityHash64
Introduced in: v1.1.0 Produces a 64-bit CityHash hash value. This is a fast non-cryptographic hash function. It uses the CityHash algorithm for string parameters and implementation-specific fast non-cryptographic hash function for parameters with other data types. The function uses the CityHash combinator to get the final results.Google changed the algorithm of CityHash after it was added to ClickHouse.
In other words, ClickHouse’s cityHash64 and Google’s upstream CityHash now produce different results.
ClickHouse cityHash64 corresponds to CityHash v1.0.2.
The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt64
Examples
Call example
Query
Response
Query
Response
farmFingerprint64
Introduced in: v20.12.0 Produces a 64-bit FarmHash value using theFingerprint64 method.
The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt64
Examples
Usage example
Query
Response
farmHash64
Introduced in: v1.1.0 Produces a 64-bit FarmHash using theHash64 method.
The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt64
Examples
Usage example
Query
Response
gccMurmurHash
Introduced in: v20.1.0 Computes the 64-bit MurmurHash2 hash of the input value using the same seed as used by GCC. It is portable between Clang and GCC builds. Syntaxarg1[, arg2, ...]— A variable number of arguments for which to compute the hash.Any
UInt64
Examples
Usage example
Query
Response
halfMD5
Introduced in: v1.1.0 Interprets all the input parameters as strings and calculates the MD5 hash value for each of them. Then combines hashes, takes the first 8 bytes of the hash of the resulting string, and interprets them as UInt64 in big-endian byte order. The function is relatively slow (5 million short strings per second per processor core). Consider using thesipHash64 function instead.
The function takes a variable number of input parameters.
Arguments can be any of the supported data types.
For some data types calculated value of hash function may be the same for the same values even if types of arguments differ (integers of different size, named and unnamed Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data).
Syntax
arg1[, arg2, ..., argN]— Variable number of arguments for which to compute the hash.Any
UInt64 in big-endian byte order. UInt64
Examples
Usage example
Query
Response
hiveHash
Introduced in: v20.1.0 Calculates a “HiveHash” from a string. This is justJavaHash with zeroed out sign bits.
This function is used in Apache Hive for versions before 3.0.
Syntax
arg— Input string to hash.String
Int32
Examples
Usage example
Query
Response
icebergHash
Introduced in: v25.5.0 Implements the logic of the iceberg hashing transform Syntaxvalue— Source value to take the hash ofIntegerorBoolorDecimalorFloat*orStringorFixedStringorUUIDorDateorTimeorDateTime
Int32
Examples
Example
Query
Response
intHash32
Introduced in: v1.1.0 Calculates a 32-bit hash of an integer. The hash function is relatively fast but not cryptographic hash function. Syntaxarg— Integer to hash.(U)Int*
UInt32
Examples
Usage example
Query
Response
intHash64
Introduced in: v1.1.0 Calculates a 64-bit hash of an integer. The hash function is relatively fast (even faster thanintHash32) but not a cryptographic hash function.
Syntax
int— Integer to hash.(U)Int*
UInt64
Examples
Usage example
Query
Response
javaHash
Introduced in: v20.1.0 Calculates JavaHash from:Java only supports calculating the hash of signed integers,
so if you want to calculate a hash of unsigned integers you must cast them to the proper signed ClickHouse types.
arg— Input value to hash.Any
arg Int32
Examples
Usage example 1
Query
Response
Query
Response
javaHashUTF16LE
Introduced in: v20.1.0 Calculates JavaHash from a string, assuming it contains bytes representing a string in UTF-16LE encoding. Syntaxarg— A string in UTF-16LE encoding.String
Int32
Examples
Usage example
Query
Response
jumpConsistentHash
Introduced in: v1.1.0 Calculates the jump consistent hash for an integer. SyntaxInt32
Examples
Usage example
Query
Response
kafkaMurmurHash
Introduced in: v23.4.0 Calculates the 32-bit MurmurHash2 hash of the input value using the same seed as used by Kafka and without the highest bit to be compatible with Default Partitioner. Syntaxarg1[, arg2, ...]— A variable number of parameters for which to compute the hash.Any
UInt32
Examples
Usage example
Query
Response
keccak256
Introduced in: v25.4.0 Calculates the Keccak-256 cryptographic hash of the given string. This hash function is widely used in blockchain applications, particularly Ethereum. Syntaxmessage— The input string to hash.String
FixedString(32)
Examples
Usage example
Query
Response
kostikConsistentHash
Introduced in: v22.6.0 An O(1) time and space consistent hash algorithm by Konstantin ‘Kostik’ Oblakov. Only efficient withn <= 32768.
Syntax
yandexConsistentHash
Arguments
Returned value
Returns the computed hash value. UInt16
Examples
Usage example
Query
Response
metroHash64
Introduced in: v1.1.0 Produces a 64-bit MetroHash hash value.The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt64
Examples
Usage example
Query
Response
murmurHash2_32
Introduced in: v18.5.0 Computes the MurmurHash2 hash of the input value.The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt32
Examples
Usage example
Query
Response
murmurHash2_64
Introduced in: v18.10.0 Computes the MurmurHash2 hash of the input value.The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt64
Examples
Usage example
Query
Response
murmurHash3_128
Introduced in: v18.10.0 Computes the 128-bit MurmurHash3 hash of the input value. Syntaxarg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
MurmurHash3 hash value of the input arguments. FixedString(16)
Examples
Usage example
Query
Response
murmurHash3_32
Introduced in: v18.10.0 Produces a MurmurHash3 hash value.The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt32
Examples
Usage example
Query
Response
murmurHash3_64
Introduced in: v18.10.0 Computes the MurmurHash3 hash of the input value.The calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
UInt64
Examples
Usage example
Query
Response
ngramMinHash
Introduced in: v21.1.0 Splits a ASCII string into n-grams ofngramsize symbols and calculates hash values for each n-gram and returns a tuple with these hashes.
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case sensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple
Examples
Usage example
Query
Response
ngramMinHashArg
Introduced in: v21.1.0 Splits a ASCII string into n-grams ofngramsize symbols and returns the n-grams with minimum and maximum hashes, calculated by the ngramMinHash function with the same input.
It is case sensitive.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum n-grams each. Tuple(String)
Examples
Usage example
Query
Response
ngramMinHashArgCaseInsensitive
Introduced in: v21.1.0 Splits a ASCII string into n-grams ofngramsize symbols and returns the n-grams with minimum and maximum hashes, calculated by the ngramMinHashCaseInsensitive function with the same input.
It is case insensitive.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum n-grams each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
ngramMinHashArgCaseInsensitiveUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into n-grams ofngramsize symbols and returns the n-grams with minimum and maximum hashes, calculated by the ngramMinHashCaseInsensitiveUTF8 function with the same input.
It is case insensitive.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum n-grams each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
ngramMinHashArgUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into n-grams ofngramsize symbols and returns the n-grams with minimum and maximum hashes, calculated by the ngramMinHashUTF8 function with the same input.
It is case sensitive.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum n-grams each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
ngramMinHashCaseInsensitive
Introduced in: v21.1.0 Splits a ASCII string into n-grams ofngramsize symbols and calculates hash values for each n-gram and returns a tuple with these hashes
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case insensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String. String. -ngramsize— The size of an n-gram. Optional. Possible values: any number from1to25. Default value:3. UInt8. -hashnum— The number of minimum and maximum hashes used to calculate the result. Optional. Possible values: any number from1to25. Default value:6. UInt8.
Tuple
Examples
Usage example
Query
Response
ngramMinHashCaseInsensitiveUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into n-grams ofngramsize symbols and calculates hash values for each n-gram and returns a tuple with these hashes..
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case insensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple
Examples
Usage example
Query
Response
ngramMinHashUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into n-grams ofngramsize symbols and calculates hash values for each n-gram and returns a tuple with these hashes.
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case sensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple
Examples
Usage example
Query
Response
ngramSimHash
Introduced in: v21.1.0 Splits a ASCII string into n-grams ofngramsize symbols and returns the n-gram simhash.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the case sensitivesimhash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
ngramSimHashCaseInsensitive
Introduced in: v21.1.0 Splits a ASCII string into n-grams ofngramsize symbols and returns the n-gram simhash.
It is case insensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the case insensitivesimhash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
ngramSimHashCaseInsensitiveUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into n-grams ofngramsize symbols and returns the n-gram simhash.
It is case insensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance. The smaller is the Hamming Distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
ngramSimHashUTF8
Introduced in: v21.1.0 Splits a UTF-8 encoded string into n-grams ofngramsize symbols and returns the n-gram simhash.
It is case sensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the hash.Stringngramsize— Optional. The size of an n-gram, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
sipHash128
Introduced in: v1.1.0 LikesipHash64 but produces a 128-bit hash value, i.e. the final xor-folding state is done up to 128 bits.
Syntax
arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
SipHash hash value. FixedString(16)
Examples
Usage example
Query
Response
sipHash128Keyed
Introduced in: v23.2.0 Same assipHash128 but additionally takes an explicit key argument instead of using a fixed key.
Syntax
(k0, k1)— A tuple of two UInt64 values representing the key.Tuple(UInt64, UInt64)arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
SipHash hash value of type FixedString(16). FixedString(16)
Examples
Usage example
Query
Response
sipHash128Reference
Introduced in: v23.2.0 LikesipHash128 but implements the 128-bit algorithm from the original authors of SipHash.
Syntax
arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
SipHash hash value of the input arguments. FixedString(16)
Examples
Usage example
Query
Response
sipHash128ReferenceKeyed
Introduced in: v23.2.0 Same assipHash128Reference but additionally takes an explicit key argument instead of using a fixed key.
Syntax
(k0, k1)— Tuple of two values representing the keyTuple(UInt64, UInt64)arg1[, arg2, ...]— A variable number of input arguments for which to compute the hash.Any
SipHash hash value of the input arguments. FixedString(16)
Examples
Usage example
Query
Response
sipHash64
Introduced in: v1.1.0 Produces a 64-bit SipHash hash value. This is a cryptographic hash function. It works at least three times faster than theMD5 hash function.
The function interprets all the input parameters as strings and calculates the hash value for each of them.
It then combines the hashes using the following algorithm:
- The first and the second hash value are concatenated to an array which is hashed.
- The previously calculated hash value and the hash of the third input parameter are hashed in a similar way.
- This calculation is repeated for all remaining hash values of the original input.
the calculated hash values may be equal for the same input values of different argument types.
This affects for example integer types of different size, named and unnamed
Tuple with the same data, Map and the corresponding Array(Tuple(key, value)) type with the same data.arg1[, arg2, ...]— A variable number of input arguments.Any
UInt64
Examples
Usage example
Query
Response
sipHash64Keyed
Introduced in: v23.2.0 LikesipHash64 but additionally takes an explicit key argument instead of using a fixed key.
Syntax
(k0, k1)— A tuple of two values representing the key.Tuple(UInt64, UInt64)arg1[,arg2, ...]— A variable number of input arguments.Any
UInt64
Examples
Usage example
Query
Response
wordShingleMinHash
Introduced in: v21.1.0 Splits a ASCII string into parts (shingles) ofshinglesize words, calculates hash values for each word shingle and returns a tuple with these hashes.
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case sensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple(UInt64, UInt64)
Examples
Usage example
Query
Response
wordShingleMinHashArg
Introduced in: v1.1.0 Splits a ASCII string into parts (shingles) ofshinglesize words each and returns the shingles with minimum and maximum word hashes, calculated by the wordShingleMinHash function with the same input.
It is case sensitive.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum word shingles each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
wordShingleMinHashArgCaseInsensitive
Introduced in: v21.1.0 Splits a ASCII string into parts (shingles) ofshinglesize words each and returns the shingles with minimum and maximum word hashes, calculated by the wordShingleMinHashCaseInsensitive function with the same input.
It is case insensitive.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum word shingles each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
wordShingleMinHashArgCaseInsensitiveUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into parts (shingles) ofshinglesize words each and returns the shingles with minimum and maximum word hashes, calculated by the wordShingleMinHashCaseInsensitiveUTF8 function with the same input.
It is case insensitive.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum word shingles each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
wordShingleMinHashArgUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into parts (shingles) ofshinglesize words each and returns the shingles with minimum and maximum word hashes, calculated by the wordShingleMinHashUTF8 function with the same input.
It is case sensitive.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
hashnum word shingles each. Tuple(Tuple(String))
Examples
Usage example
Query
Response
wordShingleMinHashCaseInsensitive
Introduced in: v21.1.0 Splits a ASCII string into parts (shingles) ofshinglesize words, calculates hash values for each word shingle and returns a tuple with these hashes.
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case insensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple(UInt64, UInt64)
Examples
Usage example
Query
Response
wordShingleMinHashCaseInsensitiveUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into parts (shingles) ofshinglesize words, calculates hash values for each word shingle and returns a tuple with these hashes.
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case insensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple(UInt64, UInt64)
Examples
Usage example
Query
Response
wordShingleMinHashUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into parts (shingles) ofshinglesize words, calculates hash values for each word shingle and returns a tuple with these hashes.
Uses hashnum minimum hashes to calculate the minimum hash and hashnum maximum hashes to calculate the maximum hash.
It is case sensitive.
Can be used to detect semi-duplicate strings with tupleHammingDistance.
For two strings, if the returned hashes are the same for both strings, then those strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8hashnum— Optional. The number of minimum and maximum hashes used to calculate the result, any number from1to25. The default value is6.UInt8
Tuple(UInt64, UInt64)
Examples
Usage example
Query
Response
wordShingleSimHash
Introduced in: v21.1.0 Splits a ASCII string into parts (shingles) ofshinglesize words and returns the word shingle simhash.
Is is case sensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
wordShingleSimHashCaseInsensitive
Introduced in: v21.1.0 Splits a ASCII string into parts (shingles) ofshinglesize words and returns the word shingle simhash.
It is case insensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
wordShingleSimHashCaseInsensitiveUTF8
Introduced in: v1.1.0 Splits a UTF-8 encoded string into parts (shingles) ofshinglesize words and returns the word shingle simhash.
It is case insensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming Distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
wordShingleSimHashUTF8
Introduced in: v21.1.0 Splits a UTF-8 string into parts (shingles) ofshinglesize words and returns the word shingle simhash.
It is case sensitive.
Can be used for detection of semi-duplicate strings with bitHammingDistance.
The smaller the Hamming distance of the calculated simhashes of two strings, the more likely these strings are the same.
Syntax
string— String for which to compute the hash.Stringshinglesize— Optional. The size of a word shingle, any number from1to25. The default value is3.UInt8
UInt64
Examples
Usage example
Query
Response
wyHash64
Introduced in: v22.7.0 Computes a 64-bit wyHash64 hash value. Syntaxarg— String argument for which to compute the hash.String
UInt64
Examples
Usage example
Query
Response
xxHash32
Introduced in: v20.1.0 Calculates a xxHash from a string. For the 64-bit version seexxHash64
Syntax
arg— Input string to hash.String
UInt32
Examples
Usage example
Query
Response
xxHash64
Introduced in: v20.1.0 Calculates a xxHash from a string. For the 32-bit version seexxHash32
Syntax
arg— Input string to hash.String
UInt64
Examples
Usage example
Query
Response
xxh3
Introduced in: v22.12.0 Computes a XXH3 64-bit hash value. Syntaxexpr— A list of expressions of any data type.Any
xxh3 hash value UInt64
Examples
Usage example
Query
Response
xxh3_128
Introduced in: v26.2.0 Computes a XXH3 128-bit hash value. Syntaxexpr— A list of expressions of any data type.Any
xxh3 hash value UInt128
Examples
Usage example
Query
Response