flink 滑动窗口

 

flink 滑动窗口

 

 

 

 

flink 滑动窗口

 

create table tb_orders (
order_time TIMESTAMP(3),product_id STRING,price FLOAT,
WATERMARK FOR order_time AS order_time - INTERVAL '0' MINUTE
) with (
'connector' = 'kafka',
'scan.startup.mode' = 'earliest-offset',
'topic' = 'todd_fx_tumble01',
'properties.bootstrap.servers' = '10.1.2.3:9092',
'value.format' = 'json'
);
SELECT
HOP_START(order_time, INTERVAL '1' MINUTE, INTERVAL '10' MINUTE) AS win_start,
HOP_END(order_time, INTERVAL '1' MINUTE, INTERVAL '10' MINUTE) AS win_end,
SUM(price) AS total
FROM tb_orders
group by
HOP(order_time, INTERVAL '1' MINUTE, INTERVAL '10' MINUTE)

 

上一篇:Flink Sort-Shuffle 实现简介


下一篇:Flink 运行时四大组件(二.)