-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](mtmv)Fix exception when create materialized view with cte #33988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
morrySnow
merged 1 commit into
apache:master
from
seawinde:fix_create_mv_with_cte_wrong
Apr 24, 2024
Merged
[fix](mtmv)Fix exception when create materialized view with cte #33988
morrySnow
merged 1 commit into
apache:master
from
seawinde:fix_create_mv_with_cte_wrong
Apr 24, 2024
Conversation
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
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38455 ms |
keanji-x
approved these changes
Apr 23, 2024
Contributor
|
PR approved by anyone and no changes requested. |
morrySnow
approved these changes
Apr 23, 2024
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
run p0 |
morrySnow
approved these changes
Apr 24, 2024
yiguolei
pushed a commit
that referenced
this pull request
Apr 24, 2024
) Fix exception when create materialized view with cte, after this fix, can create materialized view with following ``` CREATE MATERIALIZED VIEW mv_with_cte BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS with `test_with` AS ( select l_partkey, l_suppkey from lineitem union select ps_partkey, ps_suppkey from partsupp) select * from test_with; ``` this is brought from #28144
yiguolei
pushed a commit
that referenced
this pull request
Apr 25, 2024
) Fix exception when create materialized view with cte, after this fix, can create materialized view with following ``` CREATE MATERIALIZED VIEW mv_with_cte BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS with `test_with` AS ( select l_partkey, l_suppkey from lineitem union select ps_partkey, ps_suppkey from partsupp) select * from test_with; ``` this is brought from #28144
16 tasks
morrySnow
pushed a commit
that referenced
this pull request
Dec 5, 2024
…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
github-actions bot
pushed a commit
that referenced
this pull request
Dec 5, 2024
…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
github-actions bot
pushed a commit
that referenced
this pull request
Dec 5, 2024
…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
pushed a commit
that referenced
this pull request
Dec 6, 2024
…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
seawinde
added a commit
to seawinde/doris
that referenced
this pull request
Dec 6, 2024
…te (apache#44857) ### What problem does this PR solve? Related PR: apache#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
seawinde
added a commit
to seawinde/doris
that referenced
this pull request
Dec 6, 2024
…te (apache#44857) ### What problem does this PR solve? Related PR: apache#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
Sign up for free
to 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.
Proposed changes
Fix exception when create materialized view with cte, after this fix, can create materialized view with following
this is brought from #28144
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...