一个sql中混合使用多个MAX/AVG窗口函数,MAX的结果不正确

【详述】在一个SQL中查询每一行对应的窗口的多个列的MAX/AVG值,但得到的结果中MAX的值都是不对的
【背景】预置duplicated table数据
【业务影响】结果不正确
【是否存算分离】否
【StarRocks版本】例如:3.1.2
【集群规模】例如:1fe+3be
【附件】
SQL如下:
select time_id, res_ins_id as longID,
r2080_i10005,MAX(r2080_i10005) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as OutboundPeakTrafficUtilization,
r2080_i10006,AVG(r2080_i10006) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as OutboundBandwidthUtilization,
r2080_i10007,MAX(r2080_i10007) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as InboundPeakTrafficUtilization,
r2080_i10008,AVG(r2080_i10008) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as InboundBandwidthUtilization,
r2080_i10009,MAX(r2080_i10009) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as Traffic_OUT_Max,
r2080_i10010,AVG(r2080_i10010) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as OutboundRate,
r2080_i10011,MAX(r2080_i10011) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as Traffic_IN_Max,
r2080_i10012,AVG(r2080_i10012) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as InboundRate,
r2080_i10013,AVG(r2080_i10013) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as TrafficAvailabilityAverage,
r2080_i10014,AVG(r2080_i10014) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as ErrorPacketSendAverage,
r2080_i10015,AVG(r2080_i10015) OVER (partition by res_ins_id order by time_id rows between 3 PRECEDING and current row) as ErrorPacketReceiveAverage
from tbl_data_res_2080_15_starrocks
where from_unixtime(time_id/1000) > ‘2023-12-13 12:00:00’ and res_ins_id = ‘50086357’
order by res_ins_id,time_id;
得到的结果MAX的列结果都是错误的,但AVG的是正确的。
具体结果参考附件
Result.csv (6.7 KB)

麻烦可以提供下建表吗 是3.1.2版本对吧

https://github.com/StarRocks/starrocks/pull/34312 修复了该问题

升级到3.1.5可以解决