fix: influxdb float serialization error

This commit is contained in:
JimMoen 2023-07-07 17:42:28 +08:00
parent 4d2e8c7cbf
commit e9f1d7f2bf
No known key found for this signature in database
GPG Key ID: 87A520B4F76BA86D
2 changed files with 9 additions and 2 deletions

View File

@ -638,8 +638,10 @@ value_type([UInt, <<"u">>]) when
is_integer(UInt)
->
{uint, UInt};
value_type([Float]) when is_float(Float) ->
Float;
%% write `1`, `1.0`, `-1.0` all as float
%% see also: https://docs.influxdata.com/influxdb/v2.7/reference/syntax/line-protocol/#float
value_type([Number]) when is_number(Number) ->
Number;
value_type([<<"t">>]) ->
't';
value_type([<<"T">>]) ->

View File

@ -0,0 +1,5 @@
In InfluxDB bridging, if intend to write using the float data type but the placeholder represents the original value
as an integer without a decimal point during serialization, it will result in the failure of Influx Line Protocol serialization
and the inability to write to the InfluxDB bridge.
See also: [InfluxDB v2.7 Line-Protocol](https://docs.influxdata.com/influxdb/v2.7/reference/syntax/line-protocol/#float)