```
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.
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java
expectError("from a | dissect foo \"%{bar}\" invalid_option=3", "Invalid option for dissect: [invalid_option]");
        expectError(
            "from a | dissect foo \"%{bar}\" append_separator=3",
            "Invalid value for dissect append_separator: expected a string, but was [3]"
        );
        expectError("from a | dissect foo \"%{}\"", "Invalid pattern for dissect: [%{}]");
    }
    public void testGrokPattern() {
        LogicalPlan cmd = processingCommand("grok a \"%{WORD:foo}\"");
        assertEquals(Grok.class, cmd.getClass());
        Grok dissect = (Grok) cmd;
        assertEquals("%{WORD:foo}", dissect.parser().pattern());
        assertEquals(List.of(referenceAttribute("foo", KEYWORD)), dissect.extractedFields());
        ParsingException pe = expectThrows(ParsingException.class, () -> statement("row a = \"foo bar\" | grok a \"%{_invalid_:x}\""));
        assertThat(
            pe.getMessage(),
            containsString("Invalid pattern [%{_invalid_:x}] for grok: Unable to find pattern [_invalid_] in Grok's pattern dictionary")
        );
    }
    public void testLikeRLike() {
        LogicalPlan cmd = processingCommand("where foo like \"*bar*\"");
        assertEquals(Filter.class, cmd.getClass());
        Filter filter = (Filter) cmd;
        assertEquals(WildcardLike.class, filter.condition().getClass());
        WildcardLike like = (WildcardLike) filter.condition();
        assertEquals("*bar*", like.pattern().pattern());
        cmd = processingCommand("where foo rlike \".*bar.*\"");
        assertEquals(Filter.class, cmd.getClass());
        filter = (Filter) cmd;
        assertEquals(RLike.class, filter.condition().getClass());