HAMMING_DISTANCE
Description
Computes the Hamming Distance between two vectors of equal length. Hamming distance is the number of positions at which the corresponding elements of two equal-length strings/vectors are different.
Parameter Description
vector1: The first vector, supported typevector\<tinyint>vector2: The second vector, supported typevector\<tinyint>
Note: Both vectors must have the same length.
Return Result
Returns a bigint value representing the number of positions where elements differ between the two vectors.
Examples
- Compute the Hamming distance between two
vector\<tinyint>vectors
- Compute the Hamming distance between longer
tinyintvectors
- Compute the Hamming distance between identical vectors (result is 0)
