AWS Kinesis Analytics查询可使用滚动窗口聚合连续流?

时间:2019-02-14 06:10:38

标签: amazon-web-services amazon-kinesis amazon-kinesis-firehose amazon-kinesis-kpl

嗨,我有一个泵将数据作为json推送到Kinesis流中

{
   aName:"foo",
   aStatus:"FAILED",
   updateAt: 2019-02-13T23:48:21.732Z
},
{
   aName:"foo",
   aStatus:"FAILED",
   updateAt: 2019-02-13T23:48:22.732Z
},
{
   aName:"moo",
   aStatus:"SUCCESS",
   updateAt: 2019-02-13T23:48:23.732Z
},
{
   aName:"moo",
   aStatus:"FAILED",
   updateAt: 2019-02-13T23:48:24.732Z
},
..........
{
   aName:"foo",
   aStatus:"SUCCESS",
   updateAt: 2019-02-13T23:58:21.732Z
},
{
   aName:"foo",
   aStatus:"FAILED",
   updateAt: 2019-02-13T23:58:22.732Z
},
{
   aName:"moo",
   aStatus:"FAILED",
   updateAt: 2019-02-13T23:58:23.732Z
},
{
   aName:"moo",
   aStatus:"FAILED",
   updateAt: 2019-02-13T23:48:24.732Z
}

我希望输出像

ANAME |  ASTATUS  |  COUNT
foo     FAILED        2   <-- First Window
moo     FAILED        1   <-- First Window
moo     FAILED        1   <-- First Window
...
foo     FAILED        1   <-- Second Window
foo     SUCCESS        1   <-- Second Window
moo     FAILED        2   <-- Second Window

这应该是什么SQL?

0 个答案:

没有答案