Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky test in bvector.slt #512

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/sqllogictest/bvector.slt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ statement ok
SET search_path TO pg_temp, vectors;

statement ok
CREATE TABLE t (val bvector(3));
CREATE TABLE t (val bvector(10));

statement ok
INSERT INTO t (val) SELECT ARRAY[ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0)]::real[]::vector::bvector FROM generate_series(1, 1000);
INSERT INTO t (val) SELECT ARRAY[ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0), ROUND(RANDOM()::numeric, 0)]::real[]::vector::bvector FROM generate_series(1, 1000);

statement ok
CREATE INDEX ON t USING vectors (val bvector_l2_ops)
Expand All @@ -24,22 +24,22 @@ CREATE INDEX ON t USING vectors (val bvector_jaccard_ops)
WITH (options = "[indexing.hnsw]");

query I
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <-> '[0,1,0]'::bvector limit 10) t2;
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <-> '[0,1,0,0,0,0,0,0,0,0]'::bvector limit 10) t2;
----
10

query I
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <#> '[0,1,0]'::bvector limit 10) t2;
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <#> '[0,1,0,0,0,0,0,0,0,0]'::bvector limit 10) t2;
----
10

query I
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <=> '[0,1,0]'::bvector limit 10) t2;
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <=> '[0,1,0,0,0,0,0,0,0,0]'::bvector limit 10) t2;
----
10

query I
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <~> '[0,1,0]'::bvector limit 10) t2;
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <~> '[0,1,0,0,0,0,0,0,0,0]'::bvector limit 10) t2;
----
10

Expand Down
Loading