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
The parser should support the shorthand operators, introduced with Oracle 23.4 (vector functionality). Currently, the code below leads to parse errors. As a workaround, the classical syntax can be used.
SELECT doc_id, chunk_id, chunk_data
FROM doc_chunks
ORDER BY chunk_embedding <-> :query_vector -- shorthand for EUCLIDEAN
FETCH FIRST 4 ROWS ONLY;
SELECT doc_id, chunk_id, chunk_data
FROM doc_chunks
ORDER BY chunk_embedding <=> :query_vector -- shorthand for COSINE
FETCH FIRST 4 ROWS ONLY;
SELECT doc_id, chunk_id, chunk_data
FROM doc_chunks
ORDER BY chunk_embedding <#> :query_vector -- SHORTHAND FOR DOT
FETCH FIRST 4 ROWS ONLY;
The text was updated successfully, but these errors were encountered:
Yes, these shorthand operators for distances were introduced in 23.4 and documented in May 2024. Therefore I consider this an enhancement request and not a bug.
Here are the examples using the "classical" syntax (functions instead of operators) that do not cause parse errors in version 5.0.1:
-- alternative for <->select doc_id, chunk_id, chunk_data
from doc_chunks
order by vector_distance(chunk_embedding, :query_vector, euclidean)
fetch first 4 rows only;
-- alternative for <=>select doc_id, chunk_id, chunk_data
from doc_chunks
order by vector_distance(chunk_embedding, :query_vector, cosine)
fetch first 4 rows only;
-- alternative for <#> operatorselect doc_id, chunk_id, chunk_data
from doc_chunks
order by vector_distance(chunk_embedding, :query_vector, dot)
fetch first 4 rows only;
The parser should support the shorthand operators, introduced with Oracle 23.4 (vector functionality). Currently, the code below leads to parse errors. As a workaround, the classical syntax can be used.
The text was updated successfully, but these errors were encountered: