Duplicate fieldKey name with different fieldType


#1

Hi,

I am not sure what happened in this scenario.

image

Any suggestion would be very helpful


#2

Hi ,

That is because you can have a different datatype for the same field per shard.
But not two different datatypes for that field within the same shard.
You will not be able to insert the other datatype untill the shard expires …
If your shard duration is 1h , you can

Insert  invalid_age cnt=108i

One hour later you can insert

 Insert invalid_age cnt=108.0

This link explains it better …
Field type discrepanties


#3

Hi,

So basically shard is “data” in a particular time period in influxdb. Am i right?

Thanks!


#4

Yes you are right ,
and that time period is the shard duration defined in the retention policy

Have a nice weekend and don’t forget to check the box as solved :slight_smile:


#5

Thank you very much!
You too! :smile: