asg017 / sqlite-vss

A SQLite extension for efficient vector search, based on Faiss!
MIT License
1.59k stars 58 forks source link

FaissException when virtual table is empty #129

Open tap2k opened 2 months ago

tap2k commented 2 months ago

Currently there is a FaissException whenever the virtual table is empty. This causes a lot of problems as the system terminates without throwing an exception or any warning. Is there any way to check if the virtual table is empty before running the query? Or is there a more elegant solution?

libc++abi: terminating due to uncaught exception of type faiss::FaissException: Error in virtual void faiss::IndexFlat::search(idx_t, const float , idx_t, float , idx_t , const SearchParameters ) const at /Users/alex/actions/sqlite-vss-runner/_work/sqlite-vss/sqlite-vss/vendor/faiss/faiss/IndexFlat.cpp:34: Error: 'k > 0' failed

Volland commented 2 months ago

I have same issue https://github.com/asg017/sqlite-vss/issues/126

tap2k commented 2 months ago

Are you able to catch the exception in the try block?