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
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
The text was updated successfully, but these errors were encountered:
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.
MRE
The text was updated successfully, but these errors were encountered: