我创建了一个表
create table Bid(
auction BIGINT,
bidder BIGINT,
price BIGINT,
channel VARCHAR,
url VARCHAR,
dateTime TIMESTAMP(3),
extra VARCHAR,
`record_time` TIMESTAMP_LTZ(3) METADATA FROM 'tenter image description hereimestamp' ,
WATERMARK FOR dateTime AS dateTime - INTERVAL '4' SECOND)
with ( 'connector' = 'kafka',
'topic' = 'test',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'latest-offset',
'format' = 'csv');
当我跑步时
SELECT window_start, window_end, COUNT(*)
FROM TABLE(
TUMBLE(TABLE Bid, DESCRIPTOR(dateTime), INTERVAL '1' SECOND))
GROUP BY window_start, window_end;
无论我运行数据生成器多久,都不会返回结果。
但我确信窗口中有数据,因为我可以从中获得结果
select `record_time`,window_start, window_end
FROM TABLE(TUMBLE(TABLE Bid, DESCRIPTOR(dateTime), INTERVAL '1' SECOND));
结果是
我检查了 Flink Web 监视器,可以看到有收到记录
尝试运行这个
SELECT window_start, max(window_end) window_end, COUNT(*) FROM TABLE(TUMBLE(TABLE Bid, DESCRIPTOR(dateTime), INTERVAL '1' SECOND)) GROUP BY window_start;