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

QueryTranslator: Implemented predictive index support #2141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snej
Copy link
Collaborator

@snej snej commented Sep 18, 2024

When implementing the QueryTranslator, I screwed up and forgot to implement index-based predictive queries. Early on in development I commented out groups of tests I hadn't gotten working yet, and somehow I forgot to take out the #ifdefs for the predictive-index tests, which is why I didn't notice the problem.

This PR remedies that. Unfortunately it required more code change than I'd like, because predictive indexes work differently than vector or FTS, in that the query works with or without an index. That means when parsing a PREDICTION() call the parser has to know whether an index exists, which involves calling out to the QueryTranslator's delegate. That's where the ParseDelegate comes from.

Smaller changes:

  • Factored out some common code into IndexedNode so the new code can use it
  • Renamed "indexExpressionJSON" to "indexID" because the name was misleading, as it isn't always JSON.

@cbl-bot
Copy link

cbl-bot commented Sep 18, 2024

Code Coverage Results:

Type Percentage
branches 66.07
functions 78.73
instantiations 33.19
lines 77.71
regions 73.34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants