Skip to content

branch-2.1: [fix](mtmv) Fix refresh materialized view fail when mv def contains cte #44857 - #45021

Closed
github-actions[bot] wants to merge 1 commit into
branch-2.1from
auto-pick-44857-branch-2.1
Closed

branch-2.1: [fix](mtmv) Fix refresh materialized view fail when mv def contains cte #44857#45021
github-actions[bot] wants to merge 1 commit into
branch-2.1from
auto-pick-44857-branch-2.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #44857

@doris-robot

Copy link
Copy Markdown

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?

@doris-robot

Copy link
Copy Markdown

run buildall

…te (#44857)
### What problem does this PR solve?
Related PR: #33988
Problem Summary:
if mv def contain cte and is partition mv, such as following:
CREATE MATERIALIZED VIEW mv_name
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
PARTITION BY (l_shipdate)
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1') AS
WITH scan_data_cte as (
select t1.l_shipdate, t1.L_LINENUMBER, orders.O_CUSTKEY, l_suppkey
from (select * from lineitem where L_LINENUMBER > 1) t1
left join orders on t1.L_ORDERKEY = orders.O_ORDERKEY
)
SELECT * FROM scan_data_cte; if run refresh cmd as following, this would fail, throw exception `no
partition for this tuple`, this pr fix this
refresh materialized view mv_name partitions(p_20231210_20231211);
### Release note
Fix refresh materialized view fail when mv def contains cte
@yiguolei
yiguoleiforce-pushed the auto-pick-44857-branch-2.1 branch from 5732812 to 290532eCompareDecember 6, 2024 01:29
@yiguoleiyiguolei closed this Dec 9, 2024
@dataroaring
dataroaring deleted the auto-pick-44857-branch-2.1 branch December 27, 2024 07:02
Sign up for freeto 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

@doris-robot@yiguolei@dataroaring@seawinde