Skip to content

Commit

Permalink
added a null value insert in the empty table empty index test case in…
Browse files Browse the repository at this point in the history
… hnsw_create
  • Loading branch information
therealdarkknight committed Dec 27, 2023
1 parent af15c88 commit 4c114a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/expected/hnsw_create.out
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ INFO: done init usearch index
INFO: inserted 0 elements
INFO: done saving 0 vectors
begin;
-- Our index then infers the dimension from the first inserted row
-- Inserting a NULL vector should only insert it into the table and not into our index
-- So, our index is still empty after and is yet to pick up a dimension
INSERT INTO small_world5 (id, v) VALUES ('200', NULL);
-- Our index then infers the dimension from the first inserted non-NULL row
INSERT INTO small_world5 (id, v) VALUES
('000', '{1,0,0,0,1}'),
('001', '{1,0,0,1,2}'),
Expand Down
6 changes: 5 additions & 1 deletion test/sql/hnsw_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ CREATE TABLE small_world5 (
CREATE INDEX small_world5_hnsw_idx ON small_world5 USING hnsw (v dist_l2sq_ops);

begin;
-- Our index then infers the dimension from the first inserted row
-- Inserting a NULL vector should only insert it into the table and not into our index
-- So, our index is still empty after and is yet to pick up a dimension
INSERT INTO small_world5 (id, v) VALUES ('200', NULL);

-- Our index then infers the dimension from the first inserted non-NULL row
INSERT INTO small_world5 (id, v) VALUES
('000', '{1,0,0,0,1}'),
('001', '{1,0,0,1,2}'),
Expand Down

0 comments on commit 4c114a3

Please sign in to comment.