VEC_DISTANCE_COSINE
Calculate Cosine distance. This function computes the Cosine distance between two vectors, measuring the cosine of the angle between them.

Syntax
VEC_DISTANCE_COSINE(v, s)Description
Example
SELECT VEC_DISTANCE_COSINE(vec_fromtext('[1,2,3]'), vec_fromtext('[3,5,7]'));
+-----------------------------------------------------------------------+
| VEC_DISTANCE_COSINE(vec_fromtext('[1,2,3]'), vec_fromtext('[3,5,7]')) |
+-----------------------------------------------------------------------+
| 0.00258509695694209 |
+-----------------------------------------------------------------------+See Also
Last updated
Was this helpful?

