influxdb-cxx
influxdb-cxx copied to clipboard
Avoid rounding of double fields
Adding a Point
with a double field which has more than 6 digits results in the value being rounded, due to the default rounding precision, see here.
This behavior might lead to field type conflicts
in the InfluxDb. These happen if the rounded value was the first one inserted into the measurement. In this case the database decides that the type for the specific value is integer, and inserting doubles into that field is not possible anymore, the following error shows up:
write failed: field type conflict: input field "value" on measurement "temp" is type float, already exists as type integer
Hi,
Which version of InfluxDB are you using?
Influx Line Protocol uses https://github.com/awegrzyn/influxdb-cxx/issues/65 i
to mark integers and nothing for floats/doubles I can't see how you could end up with such? Could you provide steps to reproduce it?
Related with this question, I have included precision management for floating point numbers at branch support_create_db Test and functionality added at this commit could help you.