I'm trying to set this data
{"database":"3c330599-0b11-5ca8-0a43-00006fcddc83","time":"2015-05-23T07:24:00Z","points":[{"name":"access_log","fields":{"IPADDR":"192.168.1.164","SIZE":126064,"SITE":"mail.articatech.com","FAMILYSITE":"articatech.com","RQS":1,"ZDATE":1432358640}}]}
Receive this error
- 500 - {"error":"field \"SIZE\" is type string, mapped as type string"}
When adding quotes in SIZE, it is working ( "SIZE":"126064")
How to force influxdb to understand that SIZE field is an integer value ?
There is currently no way to change the data type of a field. The error strongly suggests that the first value written to SIZE was a string, not an integer. As such, all subsequent values must be strings. From http://influxdb.com/docs/v0.9/concepts/reading_and_writing_data.html#schemaless-design:
"If you attempt to write data with a different type than previously used (for example writing a string to a tag that previously accepted integers), InfluxDB will reject the data."
The simplest workaround is probably to define a new field on the series, something like size_int.
I'm going to change this into a feature request to allow changing data types, as this is not a bug but rather a limitation of the current design.
I do not believe we'll be able to do this. If you want to change which type you use, you can use a new field name, use a new retention policy, or you can wait for a new shard to be created and drop the old shards.
I'm going to close this. We may consider revisiting this in the future so please open a new issue if this is something that is still needed. Thanks.
This is one of the most immensely annoying "features" of InfluxDB.
I'm using influx 1.7.1, I accepted to lose my data with "DROP MEASUREMENT X" yet SOW FIELD KEYS FROM X still shows the old fielkeys and types.
Is this sticky type on empty measurement also intended by design ?
I had the same problem.
My dirty hack:
It act.
I agree to TotallyInformation.
Most helpful comment
This is one of the most immensely annoying "features" of InfluxDB.