例如非聚合查询可以取最新的温度: select dev, floor, last_value(temperature) as last_temp from devStream TUMBLINGWINDOW(mi, 1)
聚合查询则不知如何使用last_value函数: select floor, avg(temperature) as avg_temp from devStream group by floor TUMBLINGWINDOW(mi, 1)
考虑了下面方案:
方案一:如果select支持嵌套查询应该也可以: select floor avg(last_temp) as avg_temp from (select dev,floor, last_value(temperature) as last_temp from devStream TUMBLINGWINDOW(mi, 1) t group t.floor TUMBLINGWINDOW(mi, 1)
元旦期间测过不生效