-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
ESQL: Skip multivalues in LOOKUP JOIN matches #120519
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
@@ -146,7 +146,7 @@ private static void forEachFromRelation(PhysicalPlan plan, Consumer<EsRelation> | |||
} | |||
|
|||
/** | |||
* Similar to {@link Node#forEachUp(Consumer)}, but with a custom callback to get the node children. | |||
* Similar to {@link Node#forEachUp(Class, Consumer)}, but with a custom callback to get the node children. |
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 is unrelated, just a minor docs fix
Query query = queryList.getQuery(queryPosition); | ||
if (query != null) { | ||
return query; | ||
if (skipMultiValuesMatching == false || queryList.block.getValueCount(queryPosition) == 1) { |
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 queryList.block.getValueCount(queryPosition)
is a bit weird for 2 reasons:
- It's a protected field, accessed here for convenience
- It's an abstract method (I'll run benchmarks to ensure this doesn't affect performance)
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 wonder if we should do this by changing TermQueryList
- either by making a new one or pushing a boolean into it.
/** | ||
* LOOKUP JOIN without MV matching (https://github.com/elastic/elasticsearch/issues/118780) | ||
*/ | ||
JOIN_LOOKUP_SKIP_MV(JOIN_LOOKUP_V11.isEnabled()), |
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.
Make it _V12
?
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 post-merge conflicts with the renaming approach make it very prone to get main broken. So I'll either rename it later before merging, or just remove the capability and update the other one in another PR
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.
👍
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.
That hit me a while back too. We keep bumping the same number and then everything breaks.
Query query = queryList.getQuery(queryPosition); | ||
if (query != null) { | ||
return query; | ||
if (skipMultiValuesMatching == false || queryList.block.getValueCount(queryPosition) == 1) { |
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 wonder if we should do this by changing TermQueryList
- either by making a new one or pushing a boolean into it.
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.
Tip: Hide whitespace when reviewing this file
💔 Backport failed
You can use sqren/backport to manually backport by running |
Fixes #118780
To follow the same logics of the
==
operator (Doesn't match or work at all on multivalues or nulls), we're removing the Lucene matching currently being indirectly used by LOOKUP JOIN.