Repository navigation
[ES|QL] Keep LIMIT BY above MV_EXPAND when needed - #149911
Conversation
cfd4fed to
0ec59c1
Compare
55d0b90 to
ff4d5f5
Compare
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Hi @MattAlp, I've created a changelog YAML for you. |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
|
Oh, and also remove the "error-skip" from the generative tests here: Or it will remain skipped after this is merged |
|
Thanks for the review |
7ec7331 to
861153f
Compare
6e086d4 to
37cf98b
Compare
Keep LIMIT BY above MV_EXPAND when the grouping keys are produced by the expand target. This avoids producing plans with unbound grouping references after pushdown and locks in the behavior with a regression test.
Add a dedicated ESQL capability and require it for the new LIMIT BY plus MV_EXPAND CSV regression cases so BWC lanes running older nodes skip scenarios that are known-unfixed there. Also drop stale generative tests that referenced a helper removed by this PR. Co-authored-by: Cursor <cursoragent@cursor.com>
37cf98b to
40bfe5d
Compare
Summary
This PR fixes a logical optimization bug where
LIMIT BYcould be pushed belowMV_EXPANDeven when grouping attributes are produced by the expand target.Why
For plans like:
pushing
LIMIT BYbelowMV_EXPANDcan produce unbound grouping references and fail with missing-reference errors.This change keeps
LIMIT BYaboveMV_EXPANDwhen grouping attributes are defined by the child, preserving attribute liveness through optimization.Closes #148513