feiniaofeiafei opened a new pull request, #65968: URL: https://github.com/apache/doris/pull/65968
### What problem does this PR solve? Issue: Related PR: #59116 Problem Summary: `DecomposeRepeatWithPreAggregation` splits a `Repeat` into two branches: 1. A residual `Repeat` branch containing all grouping sets except the largest one. 2. A direct pre-aggregation branch for the removed largest grouping set. Before this change, the rewrite did not preserve the internal `GROUPING_ID` column. As a result, an upper operator that references this internal column, such as an incremental materialized view plan that derives its row identifier from `GROUPING_ID`, cannot find the expected slot after the rewrite. Moreover, the residual `Repeat` previously recalculated grouping-ID values from its reduced grouping-set list. This changes the IDs associated with the original grouping sets. For example, after removing one grouping set from a `ROLLUP`, the remaining grouping sets may be renumbered from `[1, 3, 7]` to `[0, 1, 3]`. This breaks the original grouping-ID semantics and may cause collisions with the direct branch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
