doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] Doris创建物化视图导致be集群全部宕机

Open MrZHui888 opened this issue 4 years ago • 4 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

1.1.1

What's Wrong?

当我创建一个物化视图时(对应建表和物化视图可以复现),be集群全部宕机。 最后发现是因为指标列是TEXT类型导致。

What You Expected?

期望使用不合理的创建物化视图不合理时候,机器可以不宕机,这个问题很严重

How to Reproduce?

复现流程 1、建表 2、导入数据 3、创建物化视图,以下是对应的语句

CREATE TABLE test ( dt date NOT NULL COMMENT "分区日期", new_cid varchar(100) NULL COMMENT "new_cid", pv text NULL COMMENT "浏览pv", duration double NULL COMMENT "", start_cnt text NULL COMMENT "" ) ENGINE=OLAP DUPLICATE KEY(dt, new_cid) COMMENT "OLAP" PARTITION BY RANGE(dt) ( PARTITION p20221006 VALUES [('2022-10-06'), ('2022-10-07'))) DISTRIBUTED BY HASH(new_cid) BUCKETS 8 PROPERTIES ( "in_memory" = "false", "storage_format" = "V2" );

create materialized view test_mv as select dt ,new_cid ,sum(cast(pv as int)) as pv ,sum(duration) as duration ,sum(cast(start_cnt as int)) as start_cnt from test group by dt,new_cid;

Anything Else?

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

MrZHui888 avatar Oct 08 '22 08:10 MrZHui888

Materialized view don't support cast function. Please check the document above. Use Materialized view like this.

create materialized view test_mv as select dt
,new_cid
,sum(pv) as pv
,sum(duration) as duration
,sum(start_cnt) as start_cnt
from
test
group by dt,new_cid;

siriume avatar Oct 08 '22 10:10 siriume

明白了,但是不能说我使用cast function来创建物化视图导致进程崩溃,这个问题本身就不合理。不能保证用户肯定会按照规范来使用

At 2022-10-08 18:18:51, "siriume" @.***> wrote:

Materialized view don't support cast function. Please check the document above. Use Materialized view like this.

create materialized view test_mv asselect dt ,new_cid ,sum(pv) as pv ,sum(duration) as duration ,sum(start_cnt) as start_cnt from test group by dt,new_cid;

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

MrZHui888 avatar Oct 08 '22 10:10 MrZHui888

这个我们在最新的版本中验证了下,应该不会导致崩溃了,到时候升级后可以关注下。

dataalive avatar Oct 09 '22 08:10 dataalive

2.0.2版本创建物化视图也会导致宕机

eleven-f avatar Nov 17 '23 06:11 eleven-f