-
Notifications
You must be signed in to change notification settings - Fork 25.6k
EQL: Add infra for planning and query folding #52065
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
Conversation
Actual folding not yet in place
|
Pinging @elastic/es-search (:Search/EQL) |
x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plan/physical/FilterExec.java
Show resolved
Hide resolved
|
does any of this make sense to put in QL? a lot looks like boilerplate and good candidates for QL, but that could just be because the actual folding isn't implemented yet |
|
I was tempted to do that however the execution model between the SQL and EQL is likely to be different in the beginning. If it proves to remain similar, we can definitely move things in one place at least for some of nodes (like |
aleksmaus
left a comment
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.
few comments in few places maybe worth hardening against NPE?
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return executable.hashCode(); |
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.
this would NPE if executable is null
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.
The NPE cannot occur since:
- all children are non null as the plan is constructed.
- if by accident a null child is passed, the base class
Nodechecks and throws a proper exception.
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.
Thanks for the explanation!
astefan
left a comment
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. Left one comment.
| return failures.stream().map(f -> { | ||
| Location l = f.node().source().source(); | ||
| return "line " + l.getLineNumber() + ":" + l.getColumnNumber() + ": " + f.message(); | ||
| }).collect(Collectors.joining(StringUtils.NEW_LINE, "Found " + failures.size() + " problem(s)\n", StringUtils.EMPTY)); |
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.
I know it's code that already existed and you just moved it from one place to another, but I think we can do slightly better with the error message. Why not doing "Found " + failures.size() + " problem" + (failures.size() > 1 ? "s\n" : "\n")?
Actual folding not yet in place (TBD) (cherry picked from commit d52b96f)
Actual folding not yet in place.