This commit is contained in:
Aliaksandr Valialkin 2024-05-12 09:22:19 +02:00
parent bdf1983bdc
commit 3558b751ad
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -1599,6 +1599,17 @@ func (c *blockResultColumn) getMaxValue(br *blockResult) float64 {
}
}
return max
case valueTypeFloat64:
max := nan
for _, v := range c.encodedValues {
b := bytesutil.ToUnsafeBytes(v)
n := encoding.UnmarshalUint64(b)
f := math.Float64frombits(n)
if math.IsNaN(max) || f > max {
max = f
}
}
return max
case valueTypeIPv4:
return nan
case valueTypeTimestampISO8601:
@ -1696,6 +1707,17 @@ func (c *blockResultColumn) getMinValue(br *blockResult) float64 {
}
}
return min
case valueTypeFloat64:
min := nan
for _, v := range c.encodedValues {
b := bytesutil.ToUnsafeBytes(v)
n := encoding.UnmarshalUint64(b)
f := math.Float64frombits(n)
if math.IsNaN(min) || f < min {
min = f
}
}
return min
case valueTypeIPv4:
return nan
case valueTypeTimestampISO8601: