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

Refactor WhereCQLClauseAnalyzer #1485

Open
amorton opened this issue Oct 1, 2024 · 0 comments
Open

Refactor WhereCQLClauseAnalyzer #1485

amorton opened this issue Oct 1, 2024 · 0 comments
Assignees

Comments

@amorton
Copy link
Contributor

amorton commented Oct 1, 2024

from #1448

  • move all the logic for analysing the where clause into the WhereCQLClauseAnalyzer class, out of the individual filters.
  • change the class so it's ctor takes the TableSchemaObject, and analyze() accepts the DBLogicalExpression to analyse
  • refactor the rules into individual functions for the rules below, and make the tests only check if allow filtering should be turned on, no need to check if it should be turned off. They must explicitly specify the situations where allow filtering is turned on, i.e. if there is a type check if must be that the type is in a set of types, not that it is not in a set. Every rule function must have a doc comment explaining the rule.
  • only use V2 errors from ApiException
  • write unit tests to test the WhereCQLClauseAnalyzer, rather than integration tests.
  • generate warning messages from the ApiException model , add a scope called WARNING in the REQUEST family

Use the way the WriteableTableRowBuilder works as a model for the WhereCQLClauseAnalyzer

(this excludes the validity check for range queries on duration)

The rules, for columns not in the PK:

  • whereTargetHasIndex - any valid OP is eq, and there is no SAI, turn on allow filtering.
  • notEqTypesNeedFiltering - if op is NE, and type is in the list of types that need allow filtering for not equals , turn on allow filtering
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

No branches or pull requests

2 participants