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

Regex Rewrite Visitor #2600

Open
wants to merge 8 commits into
base: integration
Choose a base branch
from
Open

Conversation

apmoriarty
Copy link
Collaborator

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'.

…al executability of the query.

Added visitor that detects if a term or subtree is executable, or an 'anchor'.
avgAGB
avgAGB previously approved these changes Oct 11, 2024
@@ -387,6 +393,7 @@ protected DefaultQueryPlanner(DefaultQueryPlanner other) {
rangeStreamClass = other.rangeStreamClass;
setSourceLimit(other.sourceLimit);
setPushdownThreshold(other.getPushdownThreshold());
setRegexRewriteOptions(other.getRegexRewriteOptions());
Copy link
Collaborator

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?

Copy link
Collaborator Author

@apmoriarty apmoriarty Nov 25, 2024

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.

Copy link
Collaborator

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.

@apmoriarty apmoriarty requested review from hlgp, ivakegg and avgAGB and removed request for jwomeara November 27, 2024 10:29
/**
* Determines if a subtree is an anchor for a given query
* <p>
* An anchor is defined as an executable leaf or subtree.
Copy link
Collaborator

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?

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

Successfully merging this pull request may close these issues.

4 participants