seawinde opened a new pull request, #33808:
URL: https://github.com/apache/doris/pull/33808

   ## Proposed changes
   
   If materialized view is partitioned. the response data maybe wrong when use 
the partitioned materialized view
   such as the materialized view  as following:
   
   >         CREATE MATERIALIZED VIEW mv_110
   >         BUILD IMMEDIATE REFRESH AUTO ON MANUAL
   >         partition by(l_shipdate)
   >         DISTRIBUTED BY RANDOM BUCKETS 2
   >         PROPERTIES ('replication_num' = '1') 
   >         AS 
   >     select l_shipdate, o_orderdate, l_partkey, l_suppkey, 
sum(o_totalprice) as sum_total
   >     from lineitem
   >     left join orders on lineitem.l_orderkey = orders.o_orderkey and 
l_shipdate = o_orderdate
   >     group by
   >     l_shipdate,
   >     o_orderdate,
   >     l_partkey,
   >     l_suppkey;
   
   if it already  has the partition of `2023-10-17, 2023-10-18, 2023-10-19` and 
the base table alse has the partition `2023-10-17, 2023-10-18, 2023-10-19`.
   after add a new partition 2023-10-20` to the base table `lineitem` and the 
materialized view  has not refresh
   
   if we run query as following without materialized view, we will get data 
from `2023-10-17, 2023-10-18, 2023-10-19, 2023-10-20` partitions
   >     select l_shipdate, o_orderdate, l_partkey, l_suppkey, 
sum(o_totalprice) as sum_total
   >     from lineitem
   >     left join orders on lineitem.l_orderkey = orders.o_orderkey and 
l_shipdate = o_orderdate
   >     group by
   >     l_shipdate,
   >     o_orderdate,
   >     l_partkey,
   >     l_suppkey;
   
   but when the query hit materialized view, it will return `2023-10-17, 
2023-10-18, 2023-10-19` partition data.
   this PR fix the problem.
   
   
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to