Skip to content

ESQL: WIP: simplify PruneColumns#140835

Closed
alex-spies wants to merge 2 commits intoelastic:mainfrom
alex-spies:simplify-prune-columns
Closed

ESQL: WIP: simplify PruneColumns#140835
alex-spies wants to merge 2 commits intoelastic:mainfrom
alex-spies:simplify-prune-columns

Conversation

@alex-spies
Copy link
Contributor

@alex-spies alex-spies commented Jan 16, 2026

Do not merge.

This is an attempt at simplifying PruneColumns by removing some special casing that conceptually doesn't seem to be required, esp. when dealing with InlineStats.

Main changes:

  • Pruning does work the same inside an InlineJoin branch and outside of it.
  • We always prune Projects, not only inside InlineJoin. They may end up being empty projections (but we seem to have allowed this; Luigi implemented this, I think.)
  • Pruning aggs works the same both in InlineJoin and outside of it.
  • InlineJoin's pruning treats the join attributes as "used", preventing missing attributes from too aggressive pruning.

Most optimizer tests still pass and none exhibit the dreaded "optimized incorrectly due to missing attributes". All single node spec tests still pass.

If we go with this, we may need to make PruneColumns version-aware, because past versions probably can't deal with empty Projects.

Relates #139359
Relates #140757

@alex-spies
Copy link
Contributor Author

The reproducers mentioned in #139359 all run.

I haven't validated their results, though, but they at least don't explode with "missing attribute" anymore.

@alex-spies
Copy link
Contributor Author

Closing in favor of #141056

@alex-spies alex-spies closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants