Skip to content

branch-4.2: [fix](mtmv) Check agg/window partition keys only for tracked partition outputs #65393 - #68295

Merged
yiguolei merged 2 commits into
apache:branch-4.2from
yujun777:fix-mtmv-agg-partition-keys-check-4.2
Sep 23, 2026
Merged

yiguolei merged 2 commits into
apache:branch-4.2from
yujun777:fix-mtmv-agg-partition-keys-check-4.2

Conversation

@yujun777

Copy link
Copy Markdown
Contributor

cherry-pick: #65393

…n outputs (apache#65393)

Problem Summary:
MV partition tracking could reject valid partitioned MVs when an
aggregate, window, or rewritten PartitionTopN exists on a branch that
does not carry the MV partition column. A typical case is a left join
where the MV partitions by the left table column, while the right
subquery has row_number() or group by on unrelated keys.

Solution:
Gate aggregate/window/partition-topn partition-key validation by whether
the current plan output contains a tracked MV partition slot. Add
LogicalPartitionTopN handling for rewritten row_number ... rn = 1

---------

Co-authored-by: yangtao555 <yangtao555@jd.com>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@yujun777
yujun777 requested a review from yiguolei as a code owner September 21, 2026 01:48
@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

…o Suite.groovy

The branch-4.2 pick of the mtmv partition-key check adds focus cases to
cross_join_range_date_increment_create that call
waitingMTMVTaskFinishedWithoutAnalyze, but the helper was introduced on
master by apache#61290 which is not picked to branch-4.2, so the suite fails
with MissingMethodException.

Key changes:
- Port waitingMTMVTaskFinishedWithoutAnalyze from master Suite.groovy:
  wait for the MTMV task to reach SUCCESS without the analyze step.

Unit Test:
- Focus cases of cross_join_range_date_increment_create extracted into a
  standalone suite and run locally: passed.
@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@yujun777

Copy link
Copy Markdown
Contributor Author

run external

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 62.16% (23/37) 🎉
Increment coverage report
Complete coverage report

@yujun777

Copy link
Copy Markdown
Contributor Author

run external

@yujun777

Copy link
Copy Markdown
Contributor Author

run nonConcurrent

1 similar comment
@yujun777

Copy link
Copy Markdown
Contributor Author

run nonConcurrent

@yiguolei
yiguolei merged commit 6bff765 into apache:branch-4.2 Sep 23, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants