KeeProMise opened a new issue, #59593:
URL: https://github.com/apache/doris/issues/59593

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   doris 3.0.8 & 4+
   
   ### What's Wrong?
   
   1.Create partitioned tables and materialized views
   <img width="1054" height="760" alt="Image" 
src="https://github.com/user-attachments/assets/3697e13a-e5f8-4e13-8415-24b0cb4f4f7a";
 />
   <img width="1290" height="470" alt="Image" 
src="https://github.com/user-attachments/assets/dc3bdb21-7d0c-4ae0-88b3-076d8977b04c";
 />
   
   2.set enable_materialized_view_union_rewrite=false;
   
   explain select * from t1;
   
   <img width="1370" height="974" alt="Image" 
src="https://github.com/user-attachments/assets/c935e413-457e-432c-8b6f-3fae721de659";
 />
   
   ### What You Expected?
   
   Materialized view rewrite fail
   <img width="648" height="458" alt="Image" 
src="https://github.com/user-attachments/assets/77c207b4-74ef-4868-a34e-d5ea81c2b89e";
 />
   
   ### How to Reproduce?
   
   ```sql
   CREATE TABLE t1 (
             `k1` LARGEINT NOT NULL COMMENT '\"用户id\"',
             `k2` DATE NOT NULL COMMENT '\"数据灌入日期时间\"'
           ) ENGINE=OLAP
           DUPLICATE KEY(`k1`)
           COMMENT 'OLAP'
           PARTITION BY range(`k2`)
           (
           PARTITION p2038 VALUES [("2038-01-01"),("2038-01-03")),
           PARTITION p2020 VALUES [("2020-01-01"),("2020-01-03"))
           )
           DISTRIBUTED BY HASH(`k1`) BUCKETS 2
           PROPERTIES ('replication_num' = '1') ;
   
   
           insert into t1 values(1,"2038-01-02"),(2,"2020-01-02");
   
   
   CREATE MATERIALIZED VIEW mv1
               BUILD DEFERRED REFRESH AUTO ON MANUAL
               partition by(`k2`)
               DISTRIBUTED BY RANDOM BUCKETS 2
               PROPERTIES (
               'replication_num' = '1',
               'partition_sync_limit'='2',
               'partition_sync_time_unit'='YEAR'
               )
               AS
               SELECT * FROM t1;
   
   
   REFRESH MATERIALIZED VIEW mv1 AUTO ;           
   
   set enable_materialized_view_union_rewrite=false;
   
   explain select * from t1;
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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