VECTOR_L2_DISTANCE

functionsupportedAI & ML

docs.snowflake.com ↗

Vector functions

Computes the L2 distance between two vectors. L2 distance, also known as the Euclidean distance, is a measure of the distance between two vectors in a vector space. The distance is calculated by taking the square root of the sum of the squared differences of vector elements. The distance can be a value of zero or higher. If the distance is zero, the vectors are identical. A larger distance indicates that the vectors are farther apart.

Syntax

VECTOR_L2_DISTANCE( <vector>, <vector> )

Parameters

NameRequiredDescription
vectorrequiredThe VECTOR value to calculate the distance from.
vectorrequiredThe VECTOR value to calculate the distance to.

Returns

Returns the distance between the two input vectors as a FLOAT value.

Usage notes

See also

Referenced by