以下是我分步执行所使用的语句
第5步,筛选需要计算平均值的变量
select StreamSouce_RealData.id as id,StreamSouce_RealData.v as v ,StreamSouce_RealData.t as t
from StreamSouce_RealData INNER JOIN LookupSource_Variable on StreamSouce_RealData.id =LookupSource_Variable.F_Id
where LookupSource_Variable.F_StatisticsType=‘279834827945936133’ and LookupSource_Variable.F_Factory=‘447228517042619653’
第6步的stream源名称:StreamSource_AvgFilter
第7步,计算平均值
select id,avg(v) as v ,window_start() as ts from StreamSource_AvgFilter group by TUMBLINGWINDOW(HH ,1),id
这种写法会有数据输出。
但把5、6、7合并后,就没有输出了,如下
select StreamSouce_RealData.id as id,avg(StreamSouce_RealData.v) as v ,window_start() as ts
from StreamSouce_RealData INNER JOIN LookupSource_Variable on StreamSouce_RealData.id =LookupSource_Variable.F_Id
where LookupSource_Variable.F_StatisticsType=‘279834827945936133’ and LookupSource_Variable.F_Factory=‘447228517042619653’
group by TUMBLINGWINDOW(HH,1),StreamSouce_RealData.id