Skip to content
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

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

Merged

Conversation

seawinde
Copy link
Contributor

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

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
Contributor Author

run buildall

@morrySnow morrySnow merged commit 8a0d05d into apache:branch-2.1 Jul 5, 2024
21 of 22 checks passed
Sign up for free to 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