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

Line protocol parser's handling of missing tag value doesn't match 2.x behaviour #29

Open
trevorbonas opened this issue Aug 6, 2024 · 0 comments

Comments

@trevorbonas
Copy link

trevorbonas commented Aug 6, 2024

Consider the following invalid line protocol:

readings,readings2,fleet=Alberta velocity=21.30 1577836800000000000

This point either has two measurement names or two tags, one with a value (fleet) and one without a value (readings2).

InfluxDB OSS 2.x interprets the issue with the point as the latter and gives the following error:

{
    "code": "invalid",
    "message": "unable to parse 'readings,readings2,fleet=Alberta velocity=21.30 1577836800000000000': missing tag value"
}

The influxdb_line_protocol crate does not return an error for this line protocol point. The parser interprets the first tag key as a part of the second tag key, producing the following ParsedLine struct:

ParsedLine {
    series: Series { 
        raw_input: "readings,readings2,fleet=Alberta",
        measurement: SingleSlice("readings"),
        tag_set: Some([(SingleSlice("readings2,fleet"), SingleSlice("Alberta"))])
    },
    field_set: [(SingleSlice("velocity"), F64(21.3))],
    timestamp: Some(1577836800000000000)
}
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

No branches or pull requests

1 participant