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 KNN query when using an int field for the vector #366

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

Comments

@PavelShilin89
Copy link

Description:
When creating a table with a vector field of type int and attempting to insert data as a string array into this field, an error occurs when executing a KNN query. Instead of returning a detailed error indicating the incorrect data type for the vector field, the system returns a message about the incorrect return type in the getQueryVectorValue() function.

Expected result:
The system should correctly handle cases when an inappropriate data type is used for a vector field and return more informative errors indicating data type mismatch or incorrect format of inserted values.

ERROR 1064 (42000): Invalid data type 'int' for vector field. Use a vector-compatible type.

MRE

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

--------------
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: Manticoresearch\Buddy\Base\Plugin\Knn\Handler::getQueryVectorValue(): Return value must be of type string|false, int returned
@PavelShilin89 PavelShilin89 added the bug Something isn't working label Oct 7, 2024
@djklim87
Copy link
Contributor

djklim87 commented Oct 9, 2024

Waiting for review #371

@djklim87
Copy link
Contributor

Blocked by #372

@donhardman donhardman removed their assignment Oct 21, 2024
@djklim87
Copy link
Contributor

@PavelShilin89
Copy link
Author

PavelShilin89 commented Oct 22, 2024

Testing performed in PR - manticoresoftware/manticoresearch#2682

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

3 participants