starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

[sync materialized view]not refresh after truncate base table

Open colorfulu opened this issue 2 years ago • 1 comments

Steps to reproduce the behavior (Required)

CREATE TABLE `t2` (
                                            `k1` date,
                                            `k2` int,
                                            `k3` int
                                        ) ENGINE=OLAP
                                        DUPLICATE KEY(`k1`)
                                        COMMENT "OLAP"
                                        DISTRIBUTED BY HASH(`k1`) BUCKETS 3;
INSERT INTO t2 VALUES ("2020-11-10",3,3);
CREATE MATERIALIZED VIEW mv1
                             DISTRIBUTED BY HASH(k1) BUCKETS 10
                             REFRESH ASYNC
                             AS SELECT k1,k2 from t2;
TRUNCATE TABLE t2;
select * from mv1;

Expected behavior (Required)

Empty set (0.01 sec)

Real behavior (Required)

+------------+------+
| k1         | k2   |
+------------+------+
| 2020-11-10 |    3 |
+------------+------+

StarRocks version (Required)

  • You can get the StarRocks version by executing SQL select current_version()
+----------------------------+
| current_version()          |
+----------------------------+
| BRANCH-2.4-RELEASE f823e8b |
+----------------------------+

colorfulu avatar Aug 12 '22 07:08 colorfulu

LGTM @Astralidea

blackstar-baba avatar Aug 12 '22 07:08 blackstar-baba