Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
This will create a public issue which anybody can view and comment on.
Please provide as much information as possible. At least, this should include a description of your issue and steps to reproduce the problem. If possible please provide a summary of what steps or workarounds you have already tried, and any docs or articles you found (un)helpful.
Problem you have encountered:
When trying to do a vector search query using the
COSINE_DISTANCE
function, I kept getting null even though the column I was doing it on was an array offloat64
embeddings with 1408 values. My query embedding was also 1408 values.If you do the query in the Spanner query UI with an array of 1408 values, you'll see that the value is grayed out in the query. If you remove values until it's 1356 elements long, the array will suddenly turn orange in the query editor.
So it seems that 1356 elements is the limit for an argument passed to
COSINE_DISTANCE
.What you expected to happen:
There should be a value and the result should not be null.
Steps to reproduce:
ARRAY<FLOAT64>
column, e.g. embeddingSELECT COSINE_DISTANCE(embedding, <query_embedding>) as distance;
Other information (workarounds you have tried, documentation consulted, etc):
The workaround is to not use
COSINE_DISTANCE
and to useDOT_PRODUCT
instead.