yujun777 opened a new pull request, #67669: URL: https://github.com/apache/doris/pull/67669
Two follow-ups from the #62606 review round, both around same-named identity keys of aggregate/full-keys MVs: 1. **Resolve IVM aggregate group keys by slot identity instead of name** — an aggregate delta over a join of two tables that both expose the same column name (`GROUP BY l.id, r.id`) resolved its group keys through name-keyed lookups. A name index collapses same-named slots onto the last match, so both keys were bound to one delta slot and a `(10, 20)` group was written as `(20, 20)`, diverging from COMPLETE. The delta-side group keys are now resolved and carried by slot identity (ordered with the aggregate metadata), the apply project emits each key output from its own delta slot, and the `ivm_use_full_keys` identity conjuncts resolve their delta side by identity first. The full-keys regression with a non-full-keys counterpart covers plain INSERT, full-keys, and MOW UPDATE refresh, each cross-checked against COMPLETE. 2. **Materialize unprojected full-keys identity keys at the project layer** — with `ivm_use_full_keys` every identity key must be materialized in the stored layout, either as a visible output or under a hidden key column. The result sink judged "already projected" by column name, so a same-named key from another table (selecting only `l.id` while grouping by `l.id, r.id`) was silently dropped and the key set lost one dimension. The sink now checks projection by slot identity, and materialization moves down to the first project that drops a key, so CREATE (result sink) and refresh (olap-table sink) plans produce the same hidden-key layout. A new regression asserts the hidden key column exists (DESC with hidden columns) and that INCREMENTAL matches COMPLETE. Tests: `IvmAggDeltaHandlerTest` (33) and `IvmNormalizeMTMVJoinTest` new cases pass; the new regression cases pass and the full ivm regression set (85 suites) is green on the materialization change. Trace issue: https://github.com/apache/doris/issues/65418 -- 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]
