- Notifications
You must be signed in to change notification settings - Fork 25.5k
EQL: Deal with internally created IN in a different way for EQL #132167
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
Hi @astefan, I've created a changelog YAML for you. |
…into 118621_fix
api 'io.ous:jtoml:2.0.0' | ||
} | ||
| ||
tasks.register("loadTestData", JavaExec) { |
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.
Just for testing purposes, has nothing to do with the actual fix.
return map; | ||
} | ||
| ||
public static void main(String[] args) throws IOException { |
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 in this class are just for testing purposes, has nothing to do with the actual fix.
return super.resolveType(); | ||
} | ||
| ||
public TypeResolution validateInTypes() { |
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've added this one because I didn't want to change the resolveType
method and to be able to call it from the optimizer rule.
// double check the validity of an internally created IN (like the one created here). EQL is one where the IN | ||
// implementation is like this mechanism here has been specifically created for it | ||
if (shouldValidateIn()) { | ||
Expression.TypeResolution resolution = in.validateInTypes(); |
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 meat of the fix.
In in = (In) e; | ||
assertEquals(fa, in.value()); | ||
assertThat(in.list(), contains(ONE, TWO)); | ||
assertCombineDisjunctionsToIn((rule) -> { |
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.
Existent test methods are now tested on both types of In
(with and without validation) to prove the validation existence doesn't change anything in the existent logic.
Pinging @elastic/es-analytical-engine (Team:Analytics) |
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. Kudos for the nice, surgical approach.
…cking * upstream/main: (26 commits) [Fleet] add privileges to `kibana_system` to read integrations data (elastic#132400) Add `TestEntitlementsRule` with support for dynamic entitled node paths for testing (elastic#132077) Reduce logging frequency for GCS per project clients (elastic#132429) Skip update/100_synthetic_source tests in yamlRestCompatTests (elastic#132296) Correct exception for missing nested path (elastic#132408) Fixing esql release tests elastic#132369 (elastic#132406) Adjust date docvalue formatting to return 4xx instead of 5xx (elastic#132414) Handle nested fields with the termvectors REST API in artificial docs (elastic#92568) Only collect bulk scored vectors when exceeding min competitive (elastic#132293) Fix release tests diskbbq update (elastic#132405) ESQL: Fix skipping of generative tests (elastic#132390) Short circuit failure handling in OIDC flow (elastic#130618) Small optimization in OptimizedScalarQuantizer by using mul instead of div (elastic#132397) Aggs: Add validation to Bucket script pipeline agg (elastic#132320) ESQL: Multiple parameters in ungrouped aggs (elastic#132375) ESQL: Explain test operators (elastic#132374) EQL: Deal with internally created IN in a different way for EQL (elastic#132167) Speed up hierarchical k-means by computing distances in bulk (elastic#132384) Reduce the number of fields per document (elastic#132322) Assert current thread in ESQL (elastic#132324) ...
Fixes #118621