嗨,我有一个泵将数据作为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?