I‘m using the influxdb-php lib to read from and write to influx. I haven‘t thought much of it in the beginning and just started to import date into the db, which worked fine. But later when I added some importers, I stumbled over type conflict issues like that:
write failed: field type conflict: input field "value" on measurement "temp" is type integer, already exists as type float
So it seems that the first value I inserted was interpreted as a float (even though it doesn‘t need to be one), which resulted in that type.
Now I always need type cast to float (which I forget pretty often when implementing a new importer) even though in this measurement only integer values will be added.
Additionally the query
show field keys from temp returns this:
fieldKey fieldType -------- --------- value float value integer
So two types for one field? It is just confusing.
The question is now: is there any way to “repair” this, so that a) there is only one type which b) is integer?
Thanks for your help!