Skip to content

Conversation

@zddr
Copy link
Contributor

@zddr zddr commented Dec 7, 2023

Proposed changes

Issue Number: close #xxx

  • create MTMV support partition and AUTO refresh method
  • refresh mtmv support support specified partitions
  • MTMV support incremental updates
  • add property EXCLUDED_TRIGGER_TABLES for mv
  • Maintain MTMVCache after successful task refresh for plan rewrite(MTMV.getOrGenerateCache)
  • show partitions add "SyncWithBaseTables"
  • drop job before drop MTMV
  • task tvf add "MvId,MvDatabaseId,ErrorMsg,TaskContext,RefreshMode,RefreshPartitions"
  • add NotAllowFallback for mtmv not fallback to old planner
  • add MTMVUtils.getMTMVCanRewritePartitions() and Env.getCurrentEnv().getMtmvService().getRelationManager().getAvailableMTMVs() for plan rewrite

todo:
add case

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...

@zddr zddr marked this pull request as draft December 7, 2023 14:18
@zddr zddr marked this pull request as ready for review December 12, 2023 10:55
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Dec 15, 2023
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@wm1581066 wm1581066 requested a review from morningman December 16, 2023 08:53
@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Dec 17, 2023
@zddr
Copy link
Contributor Author

zddr commented Dec 17, 2023

run buildall

@zddr
Copy link
Contributor Author

zddr commented Dec 17, 2023

run buildall

@doris-robot
Copy link

TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Tpch sf100 test result on commit f2cca579e7571ded2ff52d62f1b1a241f28b3fcb, data reload: false

run tpch-sf100 query with default conf and session variables
q1	4699	4459	4505	4459
q2	367	155	158	155
q3	1464	1269	1243	1243
q4	1111	928	888	888
q5	3170	3180	3154	3154
q6	245	129	129	129
q7	969	483	476	476
q8	2224	2238	2204	2204
q9	6675	6673	6657	6657
q10	3258	3288	3314	3288
q11	326	199	203	199
q12	353	208	215	208
q13	4545	3801	3814	3801
q14	238	211	218	211
q15	559	526	524	524
q16	436	382	382	382
q17	1022	610	506	506
q18	7221	6913	6999	6913
q19	1542	1460	1427	1427
q20	548	323	289	289
q21	3082	2674	2688	2674
q22	347	277	279	277
Total cold run time: 44401 ms
Total hot run time: 40064 ms

run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
q1	4383	4437	4377	4377
q2	281	166	173	166
q3	3533	3534	3525	3525
q4	2403	2382	2380	2380
q5	5738	5747	5720	5720
q6	242	121	120	120
q7	2388	1889	1898	1889
q8	3533	3525	3534	3525
q9	9024	9047	9017	9017
q10	3935	4003	4012	4003
q11	508	371	395	371
q12	766	591	605	591
q13	4290	3551	3571	3551
q14	286	255	252	252
q15	570	524	519	519
q16	521	461	452	452
q17	1893	1874	1874	1874
q18	8802	8384	8342	8342
q19	1748	1759	1778	1759
q20	2261	1953	1943	1943
q21	6540	6179	6192	6179
q22	510	424	425	424
Total cold run time: 64155 ms
Total hot run time: 60979 ms

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 17, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@morningman morningman merged commit 0f3c544 into apache:master Dec 17, 2023
hello-stephen pushed a commit to hello-stephen/doris that referenced this pull request Dec 28, 2023
- create MTMV support partition and `AUTO` refresh method
- refresh mtmv support support specified partitions
- MTMV support incremental updates
- add property `EXCLUDED_TRIGGER_TABLES` for mv
- Maintain MTMVCache after successful task refresh for plan rewrite(MTMV.getOrGenerateCache)
- show partitions add "SyncWithBaseTables"
- drop job before drop MTMV
- task tvf add "MvId,MvDatabaseId,ErrorMsg,TaskContext,RefreshMode,RefreshPartitions"
- add `NotAllowFallback` for mtmv not fallback to old planner
- add `MTMVUtils.getMTMVCanRewritePartitions() `and `Env.getCurrentEnv().getMtmvService().getRelationManager().getAvailableMTMVs()` for plan rewrite
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Jan 12, 2024
- create MTMV support partition and `AUTO` refresh method
- refresh mtmv support support specified partitions
- MTMV support incremental updates
- add property `EXCLUDED_TRIGGER_TABLES` for mv
- Maintain MTMVCache after successful task refresh for plan rewrite(MTMV.getOrGenerateCache)
- show partitions add "SyncWithBaseTables"
- drop job before drop MTMV
- task tvf add "MvId,MvDatabaseId,ErrorMsg,TaskContext,RefreshMode,RefreshPartitions"
- add `NotAllowFallback` for mtmv not fallback to old planner
- add `MTMVUtils.getMTMVCanRewritePartitions() `and `Env.getCurrentEnv().getMtmvService().getRelationManager().getAvailableMTMVs()` for plan rewrite
@zddr zddr deleted the mv_partition branch March 28, 2024 02:33
morrySnow 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 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
morrySnow added a commit that referenced this pull request Jan 7, 2025
…#46474)

### What problem does this PR solve?

Related PR: #28144 #45045

Problem Summary:
if getTable return Table is not MTMV, ClassCastException raised and lead
to plan failed.
github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
…#46474)

### What problem does this PR solve?

Related PR: #28144 #45045

Problem Summary:
if getTable return Table is not MTMV, ClassCastException raised and lead
to plan failed.
github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
…#46474)

### What problem does this PR solve?

Related PR: #28144 #45045

Problem Summary:
if getTable return Table is not MTMV, ClassCastException raised and lead
to plan failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants