[feature](mtmv)create mtmv can use view#56423
Merged
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-DS: Total hot run time: 190358 ms |
ClickBench: Total hot run time: 30.75 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
morrySnow
approved these changes
Oct 20, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
starocean999
approved these changes
Oct 20, 2025
seawinde
approved these changes
Oct 20, 2025
zddr
added a commit
to zddr/incubator-doris
that referenced
this pull request
Nov 14, 2025
The main changes are as follows: - If the MTMV is in a schema change state, recheck whether the materialized view's SQL statement meets the requirements before refreshing, and check whether the PCT table has changed. - Add a data structure in the StatementContext to store the tables and views directly depended on in the plan. - Add a data structure to store the relationship between materialized views and views. - The location for adding filter conditions during partition refresh has been moved to CheckPolicy, as the previous location could only access the parsed plan. - Clear the snapshot information of the materialized view when a view is deleted or modified. # Conflicts: # fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java # fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java # fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRewriteUtil.java # fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
16 tasks
morrySnow
pushed a commit
that referenced
this pull request
Nov 17, 2025
…ew (#57958) ### What problem does this PR solve? Related PR: #56423 #56958 Problem Summary: 1. Fix partition trace fail when create partition mv with view and date_trunc 2. Fix err if use data_trunc('day', col) partition column when create partition materialized view the mv def sql would be success after this fix CREATE VIEW lineitem_daily_summary_view AS SELECT DATE_TRUNC('day', L_SHIPDATE) AS ship_date, L_RETURNFLAG, L_LINESTATUS, COUNT(*) AS order_count, SUM(L_QUANTITY) AS total_quantity, SUM(L_EXTENDEDPRICE) AS total_price, AVG(L_DISCOUNT) AS avg_discount FROM lineitem WHERE L_SHIPDATE IS NOT NULL GROUP BY ship_date, L_RETURNFLAG, L_LINESTATUS; mv def is as following SELECT ship_date, L_RETURNFLAG, SUM(order_count) AS total_orders, SUM(total_quantity) AS sum_quantity, SUM(total_price) AS sum_price, AVG(avg_discount) AS average_discount FROM lineitem_daily_summary_view GROUP BY ship_date, L_RETURNFLAG ORDER BY ship_date, L_RETURNFLAG, total_orders, sum_quantity, sum_price;
yiguolei
pushed a commit
that referenced
this pull request
Nov 18, 2025
zddr
pushed a commit
to zddr/incubator-doris
that referenced
this pull request
Nov 19, 2025
…ew (apache#57958) ### What problem does this PR solve? Related PR: apache#56423 apache#56958 Problem Summary: 1. Fix partition trace fail when create partition mv with view and date_trunc 2. Fix err if use data_trunc('day', col) partition column when create partition materialized view the mv def sql would be success after this fix CREATE VIEW lineitem_daily_summary_view AS SELECT DATE_TRUNC('day', L_SHIPDATE) AS ship_date, L_RETURNFLAG, L_LINESTATUS, COUNT(*) AS order_count, SUM(L_QUANTITY) AS total_quantity, SUM(L_EXTENDEDPRICE) AS total_price, AVG(L_DISCOUNT) AS avg_discount FROM lineitem WHERE L_SHIPDATE IS NOT NULL GROUP BY ship_date, L_RETURNFLAG, L_LINESTATUS; mv def is as following SELECT ship_date, L_RETURNFLAG, SUM(order_count) AS total_orders, SUM(total_quantity) AS sum_quantity, SUM(total_price) AS sum_price, AVG(avg_discount) AS average_discount FROM lineitem_daily_summary_view GROUP BY ship_date, L_RETURNFLAG ORDER BY ship_date, L_RETURNFLAG, total_orders, sum_quantity, sum_price;
nagisa-kunhah
pushed a commit
to nagisa-kunhah/doris
that referenced
this pull request
Dec 14, 2025
…ew (apache#57958) ### What problem does this PR solve? Related PR: apache#56423 apache#56958 Problem Summary: 1. Fix partition trace fail when create partition mv with view and date_trunc 2. Fix err if use data_trunc('day', col) partition column when create partition materialized view the mv def sql would be success after this fix CREATE VIEW lineitem_daily_summary_view AS SELECT DATE_TRUNC('day', L_SHIPDATE) AS ship_date, L_RETURNFLAG, L_LINESTATUS, COUNT(*) AS order_count, SUM(L_QUANTITY) AS total_quantity, SUM(L_EXTENDEDPRICE) AS total_price, AVG(L_DISCOUNT) AS avg_discount FROM lineitem WHERE L_SHIPDATE IS NOT NULL GROUP BY ship_date, L_RETURNFLAG, L_LINESTATUS; mv def is as following SELECT ship_date, L_RETURNFLAG, SUM(order_count) AS total_orders, SUM(total_quantity) AS sum_quantity, SUM(total_price) AS sum_price, AVG(avg_discount) AS average_discount FROM lineitem_daily_summary_view GROUP BY ship_date, L_RETURNFLAG ORDER BY ship_date, L_RETURNFLAG, total_orders, sum_quantity, sum_price;
morrySnow
pushed a commit
that referenced
this pull request
Jun 15, 2026
…atibility (#64412) Introduced by #56423, the field baseViewsOneLevel may be null for MTMVs created before that PR. This causes NPE when querying information_schema.view_dependency: Cannot invoke java.util.Set.stream() because the return value of org.apache.doris.mtmv.MTMVRelation.getBaseViewsOneLevel() is null baseViewsOneLevel is currently only used for tablefunction/MetadataGenerator, so this change is safe. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 15, 2026
…atibility (#64412) Introduced by #56423, the field baseViewsOneLevel may be null for MTMVs created before that PR. This causes NPE when querying information_schema.view_dependency: Cannot invoke java.util.Set.stream() because the return value of org.apache.doris.mtmv.MTMVRelation.getBaseViewsOneLevel() is null baseViewsOneLevel is currently only used for tablefunction/MetadataGenerator, so this change is safe. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 15, 2026
…atibility (#64412) Introduced by #56423, the field baseViewsOneLevel may be null for MTMVs created before that PR. This causes NPE when querying information_schema.view_dependency: Cannot invoke java.util.Set.stream() because the return value of org.apache.doris.mtmv.MTMVRelation.getBaseViewsOneLevel() is null baseViewsOneLevel is currently only used for tablefunction/MetadataGenerator, so this change is safe. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
morningman
pushed a commit
that referenced
this pull request
Jun 24, 2026
…atibility (#64412) Introduced by #56423, the field baseViewsOneLevel may be null for MTMVs created before that PR. This causes NPE when querying information_schema.view_dependency: Cannot invoke java.util.Set.stream() because the return value of org.apache.doris.mtmv.MTMVRelation.getBaseViewsOneLevel() is null baseViewsOneLevel is currently only used for tablefunction/MetadataGenerator, so this change is safe. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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
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.
What problem does this PR solve?
The main changes are as follows:
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)