should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
# name: test/sql/function/array/array_distance.test
# group: [array]
foreach type FLOAT
query I
SELECT array_distance([1, 2, 3]::${type}[3], [1, 2, 3]::${type}[3]);
----
0.0
statement ok
CREATE OR REPLACE TABLE arrays (l ${type}[3]);
statement ok
INSERT INTO arrays VALUES ([1, 2, 3]), ([1, 2, 4]), ([7, 8, 9]), ([-1, -2, -3]), (NULL);
query I
SELECT array_distance(l, [1, 2, 3]::${type}[3]) FROM arrays;
----
0.0
1.0
10.392304
7.483315
NULL
statement error
SELECT array_distance([1, NULL, 3]::${type}[3], [1, 2, 3]::${type}[3]);
----
left argument can not contain NULL values
statement error
SELECT array_distance([1, 2, 3]::${type}[3], [1, NULL, 3]::${type}[3]);
----
right argument can not contain NULL values
statement error
SELECT array_distance([1, 2, 3]::${type}[3], [1, 2, 3, 4]::${type}[4]);
----
array_distance: Array arguments must be of the same size
endloop