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

   ## Proposed changes
   
   Support to use mv when create async materialized view
   Such as view def is as following:
       ```sql
           create view mv as
               select o_shippriority, o_comment,
               count(distinct case when o_shippriority > 1 and o_orderkey IN 
(1, 3) then o_custkey else null end) as cnt_1,
               count(distinct case when O_SHIPPRIORITY > 2 and o_orderkey IN 
(2) then o_custkey else null end) as cnt_2,
               sum(o_totalprice) as sum_1,
               max(o_totalprice) as max_1,
               min(o_totalprice) as min_1,
               count(*)
               from orders
               where o_orderdate = '2023-12-09'
               group by
               o_shippriority,
               o_comment;;
           ```
   
   Can create materialized view like following
        ``` sql
           CREATE MATERIALIZED VIEW ${mv1_name}
           BUILD IMMEDIATE REFRESH AUTO ON MANUAL
           DISTRIBUTED BY RANDOM BUCKETS 2
           PROPERTIES (
           'replication_num' = '1'
           )
           AS
           SELECT cnt_1, cnt_2, sum_1, min_1 from ${view1_name};
        ```
   
   


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to