Improved test

This commit is contained in:
Andrew Kane
2023-03-21 11:32:16 -07:00
parent bc9e2a37ec
commit 29c7af5d18
2 changed files with 14 additions and 0 deletions

View File

@@ -50,6 +50,18 @@ SELECT cosine_distance('[1,2]', '[0,0]');
NaN
(1 row)
SELECT cosine_distance('[1,1]', '[1,1]');
cosine_distance
-----------------
0
(1 row)
SELECT cosine_distance('[1,1]', '[-1,-1]');
cosine_distance
-----------------
2
(1 row)
SELECT cosine_distance('[1,2]', '[3]');
ERROR: different vector dimensions 2 and 1
SELECT avg(v) FROM unnest(ARRAY['[1,2,3]'::vector, '[3,5,7]']) v;