EUCLIDEAN_DISTANCE
All functions > ARRAY > EUCLIDEAN_DISTANCE
Calculates the Euclidean distance between two arrays.
Signatures
Returns: Euclidean distance between the two vectors
EUCLIDEAN_DISTANCE(array1: ARRAY<DOUBLE>, array2: ARRAY<DOUBLE>) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
array1 | ARRAY<DOUBLE> | Yes | First vector (array of doubles) |
array2 | ARRAY<DOUBLE> | Yes | Second vector (array of doubles) |
Notes
- Computes L2 distance between two vectors
- Formula: sqrt(sum((x[i] - y[i])^2))
- Arrays must be same length
- Used in ML, clustering, and similarity calculations
On this page