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

Incorrect KNN query execution without specifying index parameters in float_vector field #368

Open
PavelShilin89 opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@PavelShilin89
Copy link

Description:

When creating a table with a float_vector field without specifying essential index parameters like knn_type, knn_dims, and hnsw_similarity, KNN queries result in an “Undefined array key 0” error. Even though the vector data is correctly formatted, the system cannot properly execute the query without these parameters, which define the index type, vector dimensions, and distance metric.

Expected result

The system should return a more informative error indicating the absence of required index parameters for KNN queries. Instead of the “Undefined array key 0” error, it should clearly state that knn_type, knn_dims, and hnsw_similarity need to be specified for KNN functionality.

ERROR 1064 (42000): Missing required index parameters for KNN query. Ensure 'knn_type', 'knn_dims', and 'hnsw_similarity' are defined for the 'vector' field.

MRE

--------------
CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)
--------------

--------------
INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))
--------------

--------------
SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)
--------------

ERROR 1064 (42000) at line 1: Undefined array key 0
@PavelShilin89 PavelShilin89 added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants