3

在 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);
4

0 回答 0