test(singlestore): add semantic search integration test#2900
test(singlestore): add semantic search integration test#2900duwenxin99 wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces semantic search support for SingleStore. Key changes include updating the CI pipeline to handle an API key, configuring the SingleStore tools to use the correct vector formatting for embeddings, and adding integration tests for semantic search. A technical issue was identified in the integration test SQL query where the embedding column needs explicit conversion using JSON_ARRAY_UNPACK to be compatible with the DOT_PRODUCT function.
| searchStmt := ` | ||
| SELECT content | ||
| FROM senseai_docs | ||
| ORDER BY DOT_PRODUCT(embedding, JSON_ARRAY_UNPACK(?)) DESC |
There was a problem hiding this comment.
In SingleStore, the DOT_PRODUCT function requires arguments of type VECTOR or BLOB. Since the embedding column is defined as JSON (on line 248), it must be explicitly converted using JSON_ARRAY_UNPACK() to be compatible with the function. Without this conversion, the query will fail with a type mismatch error.
| ORDER BY DOT_PRODUCT(embedding, JSON_ARRAY_UNPACK(?)) DESC | |
| ORDER BY DOT_PRODUCT(JSON_ARRAY_UNPACK(embedding), JSON_ARRAY_UNPACK(?)) DESC |
No description provided.