You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In sqlite-vec 0.1.6, inserting binary vectors fails in some scenarios.
Steps to reproduce
create virtual table test using vec0(
id text primary key,
vec float[8]
);
create virtual table test_bq using vec0(
id text primary key,
vec bit[8]
);
insert into test(id, vec)
values ('a', '[1, 0, -1, -1, 0, 0, 1, -1]');
insert into test(id, vec)
values ('b', '[0, 0, 1, -1, 1, 0, -1, -1]');
insert into test_bq(id, vec)
select id, vec_quantize_binary(vec)
from test;
insert into test(id, vec)
values ('c', '[1, 0, 1, -1, 0, 0, 1, -1]');
select id, vec_quantize_binary(vec)
from test
where id not in (select id from test_bq); -- Returns the c row, as expected
insert into test_bq(id, vec)
select id, vec_quantize_binary(vec)
from test
where id not in (select id from test_bq); -- Fails
The last insert throws an error: Error while executing SQL query on database 'test_db': Inserted vector for the "vec" column is invalid: invalid float32 vector BLOB length. Must be divisible by 4, found 1
...so something is amiss here because this should work. (The workaround for the time being is to delete all rows in the target table and insert them again.)
BTW, these minor details aside, sqlite-vec works just beautifully, I'm actually enjoying myself tinkering with it. :)
The text was updated successfully, but these errors were encountered:
In sqlite-vec 0.1.6, inserting binary vectors fails in some scenarios.
Steps to reproduce
The last insert throws an error:
Error while executing SQL query on database 'test_db': Inserted vector for the "vec" column is invalid: invalid float32 vector BLOB length. Must be divisible by 4, found 1
...so something is amiss here because this should work. (The workaround for the time being is to delete all rows in the target table and insert them again.)
BTW, these minor details aside, sqlite-vec works just beautifully, I'm actually enjoying myself tinkering with it. :)
The text was updated successfully, but these errors were encountered: