EmmyMiao87 opened a new issue #4342: URL: https://github.com/apache/incubator-doris/issues/4342
**Describe the bug** The be core when add partition on table. This table has materialized view. The materialized view has a partition column which is not key in mv. **To Reproduce** 1. create table ``` test_sys_materialized_view_2_test_add_partiton_with_mv_db.test_sys_materialized_view_2_test_add_partiton_with_mv_tb ( k0 boolean NOT NULL, k1 tinyint NOT NULL, k2 smallint NOT NULL, k3 int NOT NULL, k4 bigint NOT NULL, k5 largeint NOT NULL, k6 decimal(9, 3) NOT NULL, k7 char(5) NOT NULL, k8 date NOT NULL, k9 datetime NOT NULL, k10 varchar(20) NOT NULL, k11 double NOT NULL, k12 float NOT NULL ) PARTITION BY RANGE(k1) ( PARTITION p1 VALUES LESS THAN ("-10"), PARTITION p2 VALUES LESS THAN ("0"), PARTITION p3 VALUES LESS THAN ("10") ) DISTRIBUTED BY HASH(k4, k5) BUCKETS 10 ``` 2. create materialized view ``` CREATE MATERIALIZED VIEW s8e55_ys_materialized_view_2_test_add_partiton_with_mv_index AS SELECT k0, max(k9), min(k11), sum(k12), hll_union(hll_hash(k7)), bitmap_union(to_bitmap(k1)) from test_sys_materialized_view_2_test_add_partiton_with_mv_db.test_sys_materialized_view_2_test_add_partiton_with_mv_tb group by k0 ``` 3. add partition ``` ALTER TABLE test_sys_materialized_view_2_test_add_partiton_with_mv_db.test_sys_materialized_view_2_test_add_partiton_with_mv_tb ADD PARTITION p4 VALUES LESS THAN ("20") ``` 4. add partition failed   **Expected behavior** The partition column also must be the key in materialized view. So the mv could not be created. ---------------------------------------------------------------- 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. 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