Skip to content
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

Fix integer data type in InfluxDB Line protocol #15

Open
vykulakov opened this issue Apr 15, 2022 · 0 comments · May be fixed by #16
Open

Fix integer data type in InfluxDB Line protocol #15

vykulakov opened this issue Apr 15, 2022 · 0 comments · May be fixed by #16

Comments

@vykulakov
Copy link

vykulakov commented Apr 15, 2022

Currently, there is no difference between float and integer data types when exporting fields values via InfluxDB line protocol. It means, for example, that float 5 and integer 5 will look the same:

myMeasurement floatField=5,integerField=5

As a result, in InfluxDB they both will be treated as floats so won't be as efficient as possible.

InfluxDB documentation says that integer field values should have the i suffix to be treated as integers eventually:

Signed 64-bit integers.
Trailing i on the number specifies an integer.

See for details: Integer

So I propose to fix integer data type exporting and use the i suffix in the Line protocol.

The example above with this change will look like this:

myMeasurement floatField=5,integerField=5i
vykulakov added a commit to vykulakov/influxdb-client-rs that referenced this issue Apr 15, 2022
Closes Andorr#15

This change adds the "i" suffix to all field values with integer data type accordingly with InfluxDB Line Protocol

See for details:
* https://docs.influxdata.com/influxdb/v2.2/reference/syntax/line-protocol/#integer
@vykulakov vykulakov linked a pull request Apr 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant