Starrocks创建物化视图时不能写select *

CREATE MATERIALIZED VIEW dw_stream.xxx_amv_sr

PARTITION BY date_trunc('DAY', pt)

DISTRIBUTED BY HASH(emp_id) BUCKETS 10 REFRESH ASYNC START('2024-07-17 16:47:02') EVERY(INTERVAL 1 minute)

PROPERTIES ( "replication_num" = "3", "storage_medium" = "HDD", "auto_refresh_partitions_limit" = "5", "partition_refresh_number" = "2", "partition_ttl_number" = "2" ) AS

select emp_id ,emp_name ,pt ,sum(case when item = 'foot' then amount else 0 end) as hot_put_get_send_wo_cnt ,sum(case when item = 'finish' then amount else 0 end) as hot_put_get_finish_wo_cnt ,sum(case when item = 'foot' then amount else 0 end) as gain_put_get_send_wo_cnt ,sum(case when item = 'finish' then amount else 0 end) as gain_put_get_finish_wo_cnt from

( select emp_id ,

emp_name ,

pt ,

item,

amount,

row_number() over(partition by pt,block_id,item order by gmt_modify desc) rn

from dw_stream.xxx_dup_sr

where item in ( 'foot' ,'finish' ) )a1 where rn = 1 group by emp_id,emp_name,pt

不能写成:

CREATE MATERIALIZED VIEW dw_stream.xxx_amv_sr

PARTITION BY date_trunc('DAY', pt)

DISTRIBUTED BY HASH(emp_id) BUCKETS 10 REFRESH ASYNC START('2024-07-17 16:47:02') EVERY(INTERVAL 1 minute)

PROPERTIES ( "replication_num" = "3", "storage_medium" = "HDD", "auto_refresh_partitions_limit" = "5", "partition_refresh_number" = "2", "partition_ttl_number" = "2" ) AS

select emp_id ,emp_name ,pt ,sum(case when item = 'foot' then amount else 0 end) as hot_put_get_send_wo_cnt ,sum(case when item = 'finish' then amount else 0 end) as hot_put_get_finish_wo_cnt ,sum(case when item = 'foot' then amount else 0 end) as gain_put_get_send_wo_cnt ,sum(case when item = 'finish' then amount else 0 end) as gain_put_get_finish_wo_cnt from

( select

*

row_number() over(partition by pt,block_id,item order by gmt_modify desc) rn

from dw_stream.xxx_dup_sr

where item in ( 'foot' ,'finish' ) )a1 where rn = 1 group by emp_id,emp_name,pt

相关推荐
Yz98764 天前
Hadoop-MapReduce任务三种运行开发模式
大数据·hadoop·mapreduce·big data
JasonKQLin6 天前
gzip不同压缩等级的区别
big data
jerry6097 天前
lab1测试脚本注解
big data
Data-Miner9 天前
54页可编辑PPT | 大型集团企业数据治理解决方案
大数据·big data
雪中鱼0112 天前
Elasticsearch如何搜索日志并存储
大数据·elasticsearch·搜索引擎·全文检索·big data
雷神乐乐12 天前
Kafka相关API开发
大数据·linux·分布式·kafka·big data
云表平台16 天前
不装了,摊牌了,微软始料未及,WPS用户:我们已经在使用了
big data
跳舞的皮埃尔18 天前
6、基于Python+爬虫+LDA+决策树的《富士山下》评论数据情感分析【开题+源程序+论文】
爬虫·python·决策树·big data
:mnong1 个月前
跟着深度学习好书实践tensorflow神经网络
人工智能·python·深度学习·tensorflow·big data
微软技术栈1 个月前
Azure Data Box 80 TB 现已在中国区正式发布
microsoft·big data·azure