-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[KQL] Do not generate nested AST/Elasticsearch queries for same-level AND/OR clauses #93506
Conversation
Pinging @elastic/kibana-app-services (Team:AppServices) |
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.
Changes to core tests LGTM
Pinging @elastic/uptime (Team:uptime) |
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.
LGTM. Thanks for walking me through the code and how to read the Peg file!
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.
LGTM from uptime
… AND/OR clauses (elastic#93506) * [KQL] Do not generate nested AST for same-level AND/OR clauses * Update tests * Update snapshots
… AND/OR clauses (elastic#93506) * [KQL] Do not generate nested AST for same-level AND/OR clauses * Update tests * Update snapshots
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / "before all" hook for "should contain the right query".Timeline query tab Query tab "before all" hook for "should contain the right query"Stack Trace
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: cc @lukasolson |
Summary
Fixes #69649.
Fixes #89473.
This PR changes the KQL parser to no longer generate nested AST nodes for same-level
and
/or
clauses. This also removes the recursive nature of the parsing, which eliminates the possibility of hitting the maximum call stack size limit.For example, prior to this PR, a clause such as
foo and bar and baz
would generate the following AST (simplified for illustration purposes):Following this PR, it generates the following AST:
The corresponding Elasticsearch queries generated from these ASTs have also been simplified, so that they don't use nested
bool
queries.Checklist
Delete any items that are not applicable to this PR.
For maintainers
Release note
KQL will no longer generate nested Elasticsearch bool queries for same-level AND/OR clauses.