Skip to content

ESQL: MATCH following MV_EXPAND will produce an invalid plan #115353

@bpintea

Description

@bpintea

Description

FROM employees | STATS v = VALUES(salary) BY job_positions | MV_EXPAND v | WHERE MATCH(job_positions, "Accountant") will fail with a 500 error:

Request failed with status [INTERNAL_SERVER_ERROR]: org.elasticsearch.xpack.esql.core.QlIllegalArgumentException: Unsupported expres
sion [MATCH(job_positions, "Accountant")]
        at org.elasticsearch.xpack.esql.evaluator.EvalMapper.toEvaluator(EvalMapper.java:62)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.toEvaluator(LocalExecutionPlanner.java:560)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.planFilter(LocalExecutionPlanner.java:624)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:205)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.planLimit(LocalExecutionPlanner.java:628)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:207)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.planOutput(LocalExecutionPlanner.java:276)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:233)
        at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:174)
        at org.elasticsearch.xpack.esql.plugin.ComputeService.runCompute(ComputeService.java:457)
        at org.elasticsearch.xpack.esql.plugin.ComputeService.execute(ComputeService.java:227)
        at org.elasticsearch.xpack.esql.plugin.TransportEsqlQueryAction.lambda$innerExecute$3(TransportEsqlQueryAction.java:174)
        at org.elasticsearch.xpack.esql.session.EsqlSession.executeOptimizedPlan(EsqlSession.java:166)
        at org.elasticsearch.xpack.esql.session.EsqlSession.lambda$execute$0(EsqlSession.java:148)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:247)
        at org.elasticsearch.xpack.esql.session.EsqlSession.lambda$preAnalyze$10(EsqlSession.java:265)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:247)
        at org.elasticsearch.xpack.esql.session.IndexResolver.lambda$resolveAsMergedMapping$0(IndexResolver.java:85)

OTOH, QSTR's verification prevents a similar failure.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions