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

Tags are set to PointValues.fields when query with time() function #97

Open
bianbian opened this issue Feb 4, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@bianbian
Copy link

bianbian commented Feb 4, 2024

Specifications

  • Client Version: com.influxdb:influxdb3-java:0.5.1
  • InfluxDB Version: [InfluxDB Cloud Serverless] Storage Engine Version 3
  • Platform: macOS 14.0

We have following schema:

Measurement: energy
Tags: component, site_id
Fields: amount

Steps to reproduce:

  1. Build InfluxQL with time() function
  2. Query using influxDBClient.queryPoints(query, QueryOptions.INFLUX_QL)

Code sample to reproduce problem

String influxQL = "select time, first(amount) as amount, component, site_id from energy where site_id = 'test-251' group by time(15s)";

try (Stream<PointValues> points = influxDBClient.queryPoints(influxQL, QueryOptions.INFLUX_QL)) {
    return points;
}

Expected behavior

Measurement is set to PointValues.name
Tag: component, site_id are set to PointValues.tags
Fields: amount is set to PointValues.fields
time is set to PointValues.time

Actual behavior

Measurement is set to PointValues.name
Tags: component, site_id are set to PointValues.fields, tags are set to wrong place
Fields: amount is set to PointValues.fields
time is set to PointValues.time

Additional info

No response

@bianbian bianbian added the bug Something isn't working label Feb 4, 2024
@bednar
Copy link
Member

bednar commented Feb 5, 2024

Hello @bianbian,

Thank you for using our client and taking the time to report the issue you've encountered.

After a preliminary investigation, it appears that the issue stems from incorrect metadata reporting by the InfluxDB server. To help you continue your work without interruption, we suggest using a simplified query as a temporary solution. Here's an adjusted query that should work for your needs:

select time, amount as amount, component, site_id from energy where site_id = 'test-251'

This query modification sidesteps the problem by explicitly structuring the data selection, hopefully mitigating the issue at hand.

Rest assured, I will be contacting our server team to look into this matter and find a more permanent resolution. I aim to keep you updated with our progress and will reach out to you as soon as we have a clearer understanding or a fix for the issue.

Regards.

@bianbian
Copy link
Author

bianbian commented Feb 7, 2024

Hi Bednar,

Thanks for your investigation and prompt reply.
Actually, we are heavy on the time() function. So it's better have a solution on it.

Looking forward for your future result with your server team.
Best regards.

@brerenat
Copy link

@bianbian @bednar I think with an update to influx cloud the tags are now being returned in the tags property instead of the fields property now. At least this is what we've observed while debugging an issue where our tags are suddenly missing 😭

@bednar
Copy link
Member

bednar commented Oct 16, 2024

Hi @brerenat, could you be a bit more specific about that tags are returned in the tag property?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants