-
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
[ES|QL] Make numberOfChannels consistent with layout map by removing duplicated ChannelSet #125636
[ES|QL] Make numberOfChannels consistent with layout map by removing duplicated ChannelSet #125636
Conversation
Hi @fang-xing-esql, I've created a changelog YAML for you. |
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
Look more self contained than #125636 |
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.
I think we can merge this, but should immediately work on a long-term fix.
Attribute ids should not have duplicates in layouts to begin with. The layout should reflect what pages passed through the corresponding operators actually look like - discarding a duplicate attribute means we act as if the block was just not there and this can lead to wrong blocks being passed to operators.
/** | ||
* Create null alias with new id in ReplaceMissingFieldWithNull when there is lookup join with multiple batches. | ||
*/ | ||
REPLACE_MISSING_FIELD_WITH_NULL_NEW_ALIAS_ID_FOR_JOIN_AND_MULTIPLE_BATCHES; |
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.
Maybe the name should reflect the current fix more clearly.
When we merge this, let's make sure this gets backported as generously as #125462 was planned to. |
💔 Backport failed
You can use sqren/backport to manually backport by running |
…duplicated ChannelSet (elastic#125636) * make numberOfChannels consistent with layout (cherry picked from commit 80125a4) # Conflicts: # x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…duplicated ChannelSet (elastic#125636) * make numberOfChannels consistent with layout (cherry picked from commit 80125a4) # Conflicts: # x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
…duplicated ChannelSet (#125636) (#125720) * make numberOfChannels consistent with layout (cherry picked from commit 80125a4) # Conflicts: # x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
…duplicated ChannelSet (#125636) (#125721) * make numberOfChannels consistent with layout (cherry picked from commit 80125a4) # Conflicts: # x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
…duplicated ChannelSet (elastic#125636) (elastic#125720) * make numberOfChannels consistent with layout (cherry picked from commit 80125a4) # Conflicts: # x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
…duplicated ChannelSet (elastic#125636) * make numberOfChannels consistent with layout
Resolves: #121754
This is another option to solve this bug, if duplicated
ChannelSet
are expected to be added to the layout or it is not avoidable.This NullPointerException happens in Layout.Builder.build(), when there is null ChannelSet in Layout.Builder.channels.
A null ChannelSet could be added in Layout.Builder.channels by Layout.inverse(), if the numberOfChannels > the # of items in the layout map. `
When there are multiple batches of data node executions with lookup join and sort in the query, LocalExecutionPlanner.planEval could potentially append duplicated ChannelSet - duplicated NameId and data type, to the list of ChannelSet in Layout.Builder, which causes numberOfChannels > the # of items in the layout map when build() is called and a DefaultLayout is created.