drop table IF EXISTS iot_main_minute_agg;
CREATE TABLE iot_main_minute_agg (
`node_id` bigint NOT NULL COMMENT '点位 ID',
`device_time` DATETIME NOT NULL COMMENT '时间',
`key_id` varchar(64) not NULL COMMENT 'key',
`avg_v` double SUM DEFAULT "0" COMMENT '平均值'
)
ENGINE=OLAP
AGGREGATE KEY(node_id,device_time,key_id)
AUTO PARTITION BY RANGE (DATE_TRUNC(device_time, 'day'))()
DISTRIBUTED BY HASH(`node_id`) BUCKETS 10
PROPERTIES (
"replication_num" = "1"
);
聚合模型中,SUM 这个地方怎么实现AVG 直接定义AVG会报错!