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
Fix layout for MV_EXPAND #102916
Fix layout for MV_EXPAND #102916
Conversation
Pinging @elastic/es-ql (Team:QL) |
Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL) |
Hi @luigidellaquila, I've created a changelog YAML for you. |
@elasticmachine run elasticsearch-ci/docs |
@elasticmachine update branch |
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
List<Attribute> childOutput = mvExpandExec.child().output(); | ||
int blockSize = 5000;// TODO estimate row size and use context.pageSize() | ||
|
||
Layout.Builder layout = new Layout.Builder(); | ||
List<Layout.ChannelSet> inverse = source.layout.inverse(); | ||
var expandedName = mvExpandExec.expanded().name(); | ||
for (int index = 0; index < inverse.size(); index++) { | ||
if (childOutput.get(index).name().equals(expandedName)) { | ||
layout.append(mvExpandExec.expanded()); | ||
} else { | ||
layout.append(inverse.get(index)); | ||
} | ||
} | ||
|
||
// Layout outputLayout = outputLayout(source, mvExpandExec); | ||
Layout.Builder layout = source.layout.builder(); | ||
layout.replace(mvExpandExec.target().id(), mvExpandExec.expanded().id()); |
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 much easier to understand and verify
…into esql/mv_expand_layout
@elasticmachine run elasticsearch-ci/docs |
Fixes #102912
Fixing MV_EXPAND layout by manually replacing the input attribute with the output one (that is what practically the operator does).