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 handling of string array insertion into float_vector field #367

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 and attempting to insert a string representation of an array into this field, an error occurs when executing a KNN query. Instead of a more clear error indicating that the data format is incorrect (string instead of a numeric array), the system returns an “Undefined array key 0” message.

Expected result:

The system should properly handle cases where data for a float_vector field is inserted in the wrong format and return an informative error indicating the need to use a numeric array instead of a string.

ERROR 1064 (42000): Invalid data format for 'float_vector' field. Expected a numeric array, but received a string.

MRE

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

--------------
INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')
--------------

--------------
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