-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type conflict on insert int value in float field #3460
Comments
This is known and documented behavior, not a bug. The first point written to a series (on a given shard) determines the data type of the field(s). The way to avoid it is to write all floats with a decimal, so rather than Because of this and a host of other issues, we're considering ditching |
See "Fields" on https://influxdb.com/docs/v0.9/write_protocols/line.html for the documentation |
What concerns me with this behavior, notably with telegraf, is that it causes the whole batch insert to fail, not only the data which conflicts: |
@beckettsean int and float has no difference. So, i think we can make it coherent to |
@andyxning The information in this issue is out of date. Integers can be written to line protocol by specifying an |
What about the JSON protocol, @gunnaraasen? |
@abrkn The JSON write protocol was deprecated with version 0.9.1, disabled in InfluxDB 0.11, and removed in version 0.12: https://docs.influxdata.com/influxdb/v0.12/write_protocols/json/ |
this avoids "field type conflict" errors from InfluxDB, see influxdata/influxdb#3460 for an example
Given an error:
Once you push the first Integer value to the database, then you couldn't simply 'switch' to sending floats. Maybe altering column somehow from 'int' to 'float' would do, so you prevent data loss. happy coding:))) |
You can't even rewrite this series, because since now it's only integer series. Why the hell i'm still on Influx... |
This is not solved! |
it is also a good idea to enforce data types by using the
|
Sometimes, float measurements are integers (no decimals)
HTTP INSERT POST BODY :
results in an error :
And if it's the first insert : field type is wrongly defined as integer
Following inserts errors :
InfluxDB version : 0.9.1
The text was updated successfully, but these errors were encountered: