Deal with different types in a field

influxdb
#1

Hello,

I did a mistake when I imported data in influxdb.
My field was with the type float and I insert some data with the type string. Now, I cannot anymore write float data in this field. Is there a way to deal with this problem? I wrote the data with the python api.

I could delete the measurement or write in a new field, but I do not want. The only solution I know for the moment is to delete the Database.

Someone know another solution?

Thank!!

Gaëtan

#2

I found a solution to my problem. I post it if someone else has the same problem.
The steps are:

  1. duplicate the measurement just with float:

select value::float into “duplicate” from “mymeasurement”

  1. remove the measurement:

drop measurement “mymeasurement”

  1. copy again the in your measurement:

select value::float into “mymeasurement” from “duplicate”

  1. remove the duplicate measurement:

drop measurement “duplicate”