【发布时间】:2018-04-19 19:29:56
【问题描述】:
我必须每天对上周的数据进行分组。我能够每 10 秒检索一次历史数据,但无法按日期分组
insert into AllMeasurementsOfWeek
select findAllMeasurementByFragmentTypeAndSourceAndTimeBetween('Avg_Load','764697',(current_timestamp().minus(7 day)).toDate(),current_timestamp().toDate()) as m,current_timestamp().toDate() as time
from pattern[every timer:interval(10 sec)];
@Name("Occupancy")
@Resilient
select * from AllMeasurementsOfDay ;
以上代码将输出如下响应
{
"m": [
{
"time": "2018-04-14T17:03:14.000+02:00",
"id": "17345353",
"source": "764697",
"type": "Avg_Load",
"Average_Load": {
"loading_time": {
"unit": "min",
"value": 25
}
}
},
{
"time": "2018-04-15T17:03:14.000+02:00",
"id": "17345194",
"source": "764697",
"type": "Avg_Load",
"Avg_Load": {
"loading_time": {
"unit": "min",
"value": 25
}
}
},
{
"time": "2018-04-15T17:03:14.000+02:00",
"id": "17345194",
"source": "764697",
"type": "Avg_Load",
"Avg_Load": {
"loading_time": {
"unit": "min",
"value": 25
}
}
}
]
我应该如何访问上述回复和按日期分组?
【问题讨论】:
标签: complex-event-processing esper cumulocity