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
[BUG] one same field key with two different data type #8535
Comments
It's not typically done, but it is possible and there are mechanisms to query both of them. Types for fields are done at the shard level so each shard can have a different type. Typically, the query engine will ask all of the shards what they think the type should be and will choose one of them based on a set of priorities ( If you want to query something lower on the priority scale (such as if you wanted to query the boolean instead of the string), you would refer to the variable with The exception to that are how floats and integers are dealt with. If you query a float, any integers are converted to floats. If you query for integers (by explicitly saying While this exists, it is recommended to use the same type for each field in a measurement. You cannot write fields of different types into the same measurement within the same shard. If you do that, the points will be dropped. I hope that helps explain this. |
@jsternberg thanks for the explanation. This helps me to understand why i have both types. I dropped old shared due to a wrong migration, but if i recreate them they keep the wrong type, whereas if i play the same process on a new database it works as intended. (i'm on influx 1.7.2) |
Bug report: there has two different data type for one same field key
__System info:
InfluxDB version: ifluxdb-1.2.1-1
operating system name: CentOS7.2.1511 x86_64
when I execute the cmd 'show field keys', it will show
name: app
fieldKey fieldType
type boolean
type string
It's normal in influxdb there has two type for one field key? And i try to insert point with the two type of boolean and string,It all cause error like below
input field "type" on measurement "app" is type string, already exists as type boolean dropped=1"
and
input field "type" on measurement "app" is type boolean, already exists as type string dropped=2"
The text was updated successfully, but these errors were encountered: