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

ES|QL: KEEP * before MV_EXPAND fails resolution #103331

Closed
luigidellaquila opened this issue Dec 12, 2023 · 2 comments · Fixed by #103339
Closed

ES|QL: KEEP * before MV_EXPAND fails resolution #103331

luigidellaquila opened this issue Dec 12, 2023 · 2 comments · Fixed by #103339
Assignees
Labels
:Analytics/ES|QL AKA ESQL >bug Team:QL (Deprecated) Meta label for query languages team

Comments

@luigidellaquila
Copy link
Contributor

from employees | keep * | mv_expand first_name

throws UnresolvedException:

org.elasticsearch.xpack.ql.capabilities.UnresolvedException: Invalid call to attribute on an unresolved object ?*
        at org.elasticsearch.xpack.ql.expression.UnresolvedNamedExpression.toAttribute(UnresolvedNamedExpression.java:44)
        at org.elasticsearch.xpack.ql.expression.Expressions.asAttributes(Expressions.java:40)
        at org.elasticsearch.xpack.ql.plan.logical.Project.output(Project.java:62)
        at org.elasticsearch.xpack.esql.plan.logical.MvExpand.<init>(MvExpand.java:31)
        at org.elasticsearch.xpack.esql.parser.LogicalPlanBuilder.lambda$visitMvExpandCommand$3(LogicalPlanBuilder.java:154)
        at org.elasticsearch.xpack.esql.parser.LogicalPlanBuilder.visitCompositeQuery(LogicalPlanBuilder.java:89)
        at org.elasticsearch.xpack.esql.parser.LogicalPlanBuilder.visitCompositeQuery(LogicalPlanBuilder.java:66)
        at org.elasticsearch.xpack.esql.parser.EsqlBaseParser$CompositeQueryContext.accept(EsqlBaseParser.java:232)
        at org.elasticsearch.xpack.ql.parser.ParserUtils.typedParsing(ParserUtils.java:51)
        at org.elasticsearch.xpack.esql.parser.LogicalPlanBuilder.plan(LogicalPlanBuilder.java:73)
        at org.elasticsearch.xpack.esql.parser.LogicalPlanBuilder.visitSingleStatement(LogicalPlanBuilder.java:82)
        at org.elasticsearch.xpack.esql.parser.LogicalPlanBuilder.visitSingleStatement(LogicalPlanBuilder.java:66)
        at org.elasticsearch.xpack.esql.parser.EsqlBaseParser$SingleStatementContext.accept(EsqlBaseParser.java:169)

The problem is that MV_EXPAND tries to pre-calculate the output too early, when the resolution did not happen yet.

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:QL (Deprecated) Meta label for query languages team label Dec 12, 2023
@elasticsearchmachine
Copy link
Collaborator

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

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants