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

相关推荐
longxibo6 天前
datasophon1.2.1 二开
big data
yumgpkpm6 天前
CMP(类ClouderaCDP7.3(404次编译) )完全支持华为鲲鹏Aarch64(ARM),粉丝数超过200就开源下载
hive·hadoop·redis·mongodb·elasticsearch·hbase·big data
yumgpkpm13 天前
CMP (类ClouderaCDP7.3(404次编译) )华为鲲鹏Aarch64(ARM)信创环境 查询2100w行 hive 查询策略
数据库·数据仓库·hive·hadoop·flink·mapreduce·big data
yumgpkpm14 天前
华为鲲鹏 Aarch64 环境下多 Oracle 数据库汇聚操作指南 CMP(类 Cloudera CDP 7.3)
大数据·hive·hadoop·elasticsearch·zookeeper·big data·cloudera
yumgpkpm16 天前
CMP (类ClouderaCDP7.3(404次编译) )华为鲲鹏Aarch64(ARM)信创环境多个mysql数据库汇聚的操作指南
大数据·hive·hadoop·zookeeper·big data·cloudera
yumgpkpm18 天前
CMP平台(类Cloudera CDP7.3)在华为鲲鹏的Aarch64信创环境中的性能表现
大数据·flink·kafka·big data·flume·cloudera
yumgpkpm18 天前
大数据综合管理平台(CMP)(类Cloudera CDP7.3)有哪些核心功能?
hive·hadoop·elasticsearch·zookeeper·big data
孟意昶1 个月前
Spark专题-第三部分:性能监控与实战优化(2)-分区优化
大数据·分布式·sql·性能优化·spark·big data
喂完待续1 个月前
【序列晋升】45 Spring Data Elasticsearch 实战:3 个核心方案破解索引管理与复杂查询痛点,告别低效开发
java·后端·spring·big data·spring data·序列晋升
喂完待续1 个月前
【序列晋升】38 Spring Data MongoDB 的统一数据访问范式与实践
java·spring·spring cloud·big data·序列晋升