Skip to content

ES|QL: PruneColumns fails to prune columns when forked #136365

@GalLalouche

Description

@GalLalouche

Consider this simple query:

FROM employees | KEEP first_name | EVAL x = 1.0 | DROP x

In this case, the PruneColumns rule will remove EVAL x in the first (non-local) logical optimization.
But for this query:

FROM employees | KEEP first_name | EVAL x = 1.0 | DROP x 
| FORK (WHERE true) (WHERE true) | WHERE _fork == "fork1" | DROP _fork

It will not. The x field will eventually get dropped in the local logical optimization, but this might be too late, e.g., when performing the late materialization added in #132757.

Metadata

Metadata

Assignees

Labels

:Search Relevance/ES|QLSearch functionality in ES|QL:SearchOrg/RelevanceLabel for the Search (solution/org) Relevance team>bugTeam:Search - RelevanceThe Search organization Search Relevance teamTeam:Search RelevanceMeta label for the Search Relevance team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions