在AWS Kinesis Analytics中,如何在翻滚时间窗口之间汇总结果?
假设有10秒的翻滚时间窗口,就像来自AWS网站的给定示例一样:
CREATE OR REPLACE STREAM "DESTINATION_SQL_STREAM"
(ticker_symbol VARCHAR(4), ticker_symbol_count INTEGER);
CREATE OR REPLACE PUMP "STREAM_PUMP" AS INSERT INTO "DESTINATION_SQL_STREAM"
SELECT STREAM ticker_symbol, COUNT(*) AS ticker_symbol_count
FROM "SOURCE_SQL_STREAM_001"
GROUP BY ticker_symbol,
FLOOR(("SOURCE_SQL_STREAM_001".ROWTIME - TIMESTAMP '1970-01-01 00:00:00') SECOND / 10 TO SECOND);
每隔10秒生成一个新的翻滚窗口,结果不同。第二个窗口不跟踪先前的窗口结果。有什么方法可以将所有翻滚窗口结果合并在一起吗?
基本上有类似的东西:
CREATE OR REPLACE STREAM "DESTINATION_SQL_STREAM"
(ticker_symbol VARCHAR(4), ticker_symbol_count INTEGER);
CREATE OR REPLACE PUMP "STREAM_PUMP" AS INSERT INTO "DESTINATION_SQL_STREAM"
SELECT STREAM ticker_symbol, COUNT(*) AS ticker_symbol_count
FROM "SOURCE_SQL_STREAM_001"
--> UNION WITH RESULTS FROM THE PREVIOUS WINDOW
GROUP BY ticker_symbol,
FLOOR(("SOURCE_SQL_STREAM_001".ROWTIME - TIMESTAMP '1970-01-01 00:00:00') SECOND / 10 TO SECOND);