What is the precision and rounding on min/max stat...
# community-help
s
What is the precision and rounding on min/max stats for a int64 numeric field? I am using it with timestamp (unix seconds) and the values appear to be getting rounded. The lowest field in my collection is
1662633479
but the reported
min
in facet response is
1662633500
which is a little bit higher. Is there any chance this is being converted to float during the stats phase?
k
We do use a double for facet stats computation so it's possible that has an impact on the precision. Do you have a small reproduceable example that we can use for testing?
s
I couldn’t reproduce in curl. Turns out the conversion is happening in the go client when it parses the result. In the openapi spec the min/max/avg fields are declared to be float which is then declared a float32 in the generated code. It looks like that could be at least a float64 for golang if the spec format was ‘double’ instead of ‘float’.
k
Ah yes, that must be it.
s
I’d recommend updating the openapi spec to use double since the underlying data is often 64 bits. Fortunatley this is the only place the
float
term is used in the openapi spec so the impact to generated clients/consumers would be minor but it would probably need a ‘major’ version bump for semver sake