From 348bfb71ffc7cfb221af2557f075efe1d2f2bf39 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 4 Aug 2023 16:08:19 -0700 Subject: [PATCH] Non-deterministic order for NULL and NaN distances --- test/expected/hnsw_cosine.out | 16 ---------------- test/expected/hnsw_ip.out | 9 --------- test/sql/hnsw_cosine.sql | 2 -- test/sql/hnsw_ip.sql | 1 - 4 files changed, 28 deletions(-) diff --git a/test/expected/hnsw_cosine.out b/test/expected/hnsw_cosine.out index 9bf8f59..a5242bd 100644 --- a/test/expected/hnsw_cosine.out +++ b/test/expected/hnsw_cosine.out @@ -11,20 +11,4 @@ SELECT * FROM t ORDER BY val <=> '[3,3,3]'; [1,2,4] (3 rows) -SELECT * FROM t ORDER BY val <=> '[0,0,0]'; - val ---------- - [1,1,1] - [1,2,4] - [1,2,3] -(3 rows) - -SELECT * FROM t ORDER BY val <=> (SELECT NULL::vector); - val ---------- - [1,1,1] - [1,2,4] - [1,2,3] -(3 rows) - DROP TABLE t; diff --git a/test/expected/hnsw_ip.out b/test/expected/hnsw_ip.out index d6ae2ea..74681ce 100644 --- a/test/expected/hnsw_ip.out +++ b/test/expected/hnsw_ip.out @@ -12,13 +12,4 @@ SELECT * FROM t ORDER BY val <#> '[3,3,3]'; [0,0,0] (4 rows) -SELECT * FROM t ORDER BY val <#> (SELECT NULL::vector); - val ---------- - [1,1,1] - [1,2,4] - [1,2,3] - [0,0,0] -(4 rows) - DROP TABLE t; diff --git a/test/sql/hnsw_cosine.sql b/test/sql/hnsw_cosine.sql index 9b84d09..0dbb633 100644 --- a/test/sql/hnsw_cosine.sql +++ b/test/sql/hnsw_cosine.sql @@ -7,7 +7,5 @@ CREATE INDEX ON t USING hnsw (val vector_cosine_ops); INSERT INTO t (val) VALUES ('[1,2,4]'); SELECT * FROM t ORDER BY val <=> '[3,3,3]'; -SELECT * FROM t ORDER BY val <=> '[0,0,0]'; -SELECT * FROM t ORDER BY val <=> (SELECT NULL::vector); DROP TABLE t; diff --git a/test/sql/hnsw_ip.sql b/test/sql/hnsw_ip.sql index 8a1d8a0..050468d 100644 --- a/test/sql/hnsw_ip.sql +++ b/test/sql/hnsw_ip.sql @@ -7,6 +7,5 @@ CREATE INDEX ON t USING hnsw (val vector_ip_ops); INSERT INTO t (val) VALUES ('[1,2,4]'); SELECT * FROM t ORDER BY val <#> '[3,3,3]'; -SELECT * FROM t ORDER BY val <#> (SELECT NULL::vector); DROP TABLE t;