Skip to content

[opt](mtmv) Materialized view partition track supports date_trunc and optimize the fail reason (#35562) - #36947

Merged
morrySnow merged 1 commit into
apache:branch-2.1from
seawinde:support_date_trunc_partition_mv
Jul 5, 2024
Merged

[opt](mtmv) Materialized view partition track supports date_trunc and optimize the fail reason (#35562)#36947
morrySnow merged 1 commit into
apache:branch-2.1from
seawinde:support_date_trunc_partition_mv

Conversation

@seawinde

Copy link
Copy Markdown
Member

Proposed changes

cherry pick to 2.1
pr: #35562
commitId: 43d0f19

… optimize the fail reason (apache#35562)
this depends on apache#34781
1. Materialized view partition track supports date_trunc and optimize the fail reason.
2. it supports create partition mv as following:
this mv will be partition updated by day
CREATE MATERIALIZED VIEW mv_6
BUILD IMMEDIATE REFRESH AUTO ON MANUAL
partition by(date_trunc(date_alias, 'day'))
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS
SELECT date_trunc(t1.L_SHIPDATE, 'hour') as date_alias, t2.O_ORDERDATE, t1.L_QUANTITY, t2.O_ORDERSTATUS, count(distinct case when t1.L_SUPPKEY > 0 then t2.O_ORDERSTATUS else null end) as cnt_1 from (select * from lineitem where L_SHIPDATE in ('2017-01-30')) t1 left join (select * from orders where O_ORDERDATE in ('2017-01-30')) t2 on t1.L_ORDERKEY = t2.O_ORDERKEY group by t1.L_SHIPDATE, t2.O_ORDERDATE, t1.L_QUANTITY, t2.O_ORDERSTATUS;
@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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

@morrySnow
morrySnow merged commit 8a0d05d into apache:branch-2.1Jul 5, 2024
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.

3 participants

@seawinde@doris-robot@morrySnow