EUCLIDEAN_DISTANCE

All functions > ARRAY > EUCLIDEAN_DISTANCE

Calculates the Euclidean distance between two arrays.

Syntax

EUCLIDEAN_DISTANCE(array1, array2)
sql

Arguments

ParameterTypeRequiredDescription
array1ARRAYDOUBLEYesFirst vector (array of doubles)
array2ARRAYDOUBLEYesSecond vector (array of doubles)

Returns

DOUBLE - Euclidean distance between the two vectors

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
Last update at: 2025/10/13 10:23:46