-
Notifications
You must be signed in to change notification settings - Fork 22
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
CNDB-12456: Add ANN_OPTIONS to CQL SELECT queries #1525
base: main
Are you sure you want to change the base?
Conversation
7c35d1e
to
42a25dc
Compare
42a25dc
to
fbc3e21
Compare
fbc3e21
to
1c76376
Compare
Only the ANN expression will have the serialized options
The last commit tries the alternative approach mentioned above, placing the new |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.cassandra.index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this class would be better placed in the org.apache.cassandra.db.filter
, same as RowFilter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
Agreed
The flag makes sense to me
I like the last version - placing the new |
Thanks for the feedback. The patch is ready for review. |
Quality Gate passedIssues Measures |
✔️ Build ds-cassandra-pr-gate/PR-1525 approved by ButlerApproved by Butler |
Add
ANN_OPTIONS
to CQLSELECT
queries, as described in this document: https://docs.google.com/document/d/1Q2SkE1aBkcy25DnCWkdUqpCf8rZA6R_AOU6bbORbarIThe proposed syntax is:
The new options and not something specific to SAI, same as the
ORDER BY col ANN OF val
part.Internally, the ANN options are an attribute of the
RowFilter
included in everyReadCommand
. Every index implementation receives them as part of theReadCommand
passed in methods such asIndex.validate(ReadCommand)
,Index.Group.queryPlanFor(RowFilter)
orIndex.QueryPlan.searcherFor(ReadCommand)
.Currently SAI rejects queries with ANN options. I think consuming those options is something we can do in a separate ticket, keeping this one focused on the CQL and internode messaging part.
This patch increases the internode messaging version because the ANN options have to be included in the serialization of the
ReadCommand
they belong to. Hopefully we won't need to bump the messaging version again if we add new ANN options.I have chosen to include the options in the
RowFilter
because it seemed the cleaner approach, and so possibly less problematic when rebasing on Apache. The downside is that it adds a 32-bit int to the serialization of everySELECT
query. An alternative, possibly more convoluted approach to save us those 4 extra bytes could be placing the ANN options inside the relevant ANNRowFilter.Expression
. @jbellis @ekaterinadimitrova2 should I give a go to this alternative approach?Checklist before you submit for review
NoSpamLogger
for log lines that may appear frequently in the logs