Uh oh!
There was an error while loading. Please reload this page.
branch-4.1 [fix](rbo) Rewrite LogicalGenerate lateral conjuncts together with generators - #67399
Draft
englefly wants to merge 1 commit into
Draft
branch-4.1 [fix](rbo) Rewrite LogicalGenerate lateral conjuncts together with generators#67399englefly wants to merge 1 commit into
englefly wants to merge 1 commit into
Conversation
…er with generators ### What problem does this PR solve? Problem Summary: GenerateExpressionRewrite rewrote only LogicalGenerate.getGenerators() and rebuilt the node via withGenerators(), which preserved the lateral ON conjuncts unchanged. Whole-tree ExprId replacements (e.g. any_value wrapping of a group-by key in EliminateGroupByKeyByUniform / EliminateGroupByKey) that renamed a slot referenced by an ON conjunct therefore left the conjunct with a stale ExprId after the child switched to the wrapped slot, and final slot validation rejected the query. Fix: GenerateExpressionRewrite now rewrites getConjuncts() in the same operation and rebuilds the node with a new LogicalGenerate.withGeneratorsAndConjuncts() helper, so generators and lateral ON conjuncts stay consistent under any expression rewrite. ### Release note None ### Check List (For Author) - Test: Unit Test - New GenerateConjunctRewriteTest.testExprIdRewriterRewritesLateralConjuncts: builds a LogicalGenerate with a conjunct referencing a slot, runs ExprIdRewriter with an old->new ExprId map and asserts the conjunct is rewritten (fails on the old code: expected 999 but was the old id). - Full GenerateConjunctRewriteTest / EliminateGroupByKeyByUniformTest / MergeGeneratesTest / FdTest classes are green. - Behavior changed: No. Internal correctness fix for plan rewriting; no intended plan-shape or performance change. - Does this need documentation: No
englefly
commented
Sep 1, 2026
ContributorAuthor
run buildall |
hello-stephen
commented
Sep 1, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #66803 to branch-4.1
fix Rewrite LogicalGenerate lateral conjuncts together with generators