COSINE_SIMILARITY (Lakehouse v2)
Returns the cosine similarity between two arrays (vectors).
Analyze Syntax
Section titled “Analyze Syntax”func.cosine_similarity(<array1>, <array2>)Analyze Examples
Section titled “Analyze Examples”func.cosine_similarity([1.0, 2.0], [2.0, 4.0])
┌─────┐│ 1.0 │└─────┘SQL Syntax
Section titled “SQL Syntax”COSINE_SIMILARITY(<array1>, <array2>)SQL Examples
Section titled “SQL Examples”SELECT COSINE_SIMILARITY([1.0, 2.0], [2.0, 4.0]);
┌─────┐│ 1.0 │└─────┘