Skip to content
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

Merged
merged 5 commits into from Dec 5, 2023

Conversation

luigidellaquila
Copy link
Contributor

Fixes #102912

Fixing MV_EXPAND layout by manually replacing the input attribute with the output one (that is what practically the operator does).

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

@elasticsearchmachine
Copy link
Collaborator

Hi @luigidellaquila, I've created a changelog YAML for you.

@luigidellaquila
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/docs

@luigidellaquila
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 584 to 587
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());
Copy link
Contributor

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

@luigidellaquila
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/docs

@luigidellaquila luigidellaquila merged commit 43c320f into elastic:main Dec 5, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >bug Team:QL (Deprecated) Meta label for query languages team v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ES|QL: IndexOutOfBounds on mv_expand layout management
4 participants