-
Notifications
You must be signed in to change notification settings - Fork 246
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
Regex Rewrite Visitor #2600
base: integration
Are you sure you want to change the base?
Regex Rewrite Visitor #2600
Conversation
…al executability of the query. Added visitor that detects if a term or subtree is executable, or an 'anchor'.
warehouse/query-core/src/main/java/datawave/query/planner/DefaultQueryPlanner.java
Outdated
Show resolved
Hide resolved
post index expansion operations
@@ -387,6 +393,7 @@ protected DefaultQueryPlanner(DefaultQueryPlanner other) { | |||
rangeStreamClass = other.rangeStreamClass; | |||
setSourceLimit(other.sourceLimit); | |||
setPushdownThreshold(other.getPushdownThreshold()); | |||
setRegexRewriteOptions(other.getRegexRewriteOptions()); |
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.
Why not simply create more transform rules (see 2 lines below) instead of creating a whole new injected set of rewrite options?
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.
These are not simple transform rules. These rules are more tailored and intended to be run before and after index expansion.
To elaborate, the regex rewrite rules applied in a way that preserves query executability whereas the transform rules will always apply, even if means making a query non-executable.
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.
but.... as far as I can tell you are simply transforming nodes within the tree. I think I need to sit down with you to understand why a separate visitor. The node transform rules are supplied the node and hence its subtree, so they can do whatever they need to keep the query executable.
/** | ||
* Determines if a subtree is an anchor for a given query | ||
* <p> | ||
* An anchor is defined as an executable leaf or subtree. |
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.
does not the executability visitor already do this? How is this different?
Added visitor to that rewrites regex terms without affecting the overall executability of the query.
Added visitor that detects if a term or subtree is executable, or an 'anchor'.