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

getInfluxQLQueryApi.query() Execution results "InfluxQLQueryResult" Why is there no tag column ? #534

Closed
isMrZhang opened this issue Apr 12, 2023 · 0 comments · Fixed by #584
Assignees
Milestone

Comments

@isMrZhang
Copy link

isMrZhang commented Apr 12, 2023

getInfluxQLQueryApi.query() Execution results "InfluxQLQueryResult" Why is there no tag column ?
Works fine in influxdb-java 2.19, There is a tag column in the query results, But there is no tag column in "InfluxQLQueryResult:

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. Create Client
InfluxDBClient influxDB = InfluxDBClientFactory.createV1(url, user, password.toCharArray(), database, policy)
            .setLogLevel(LogLevel.BASIC);
  1. Build SQL
String querySqlStr = "select mean(heart_rate) AS avg,max(heart_rate) AS max,min(heart_rate) AS min,last(heart_rate) AS last from health_course_heart_rate  where course_id::tag = '572' and org_id::tag = 'EDUCLOUD' group by user_id::tag fill(0)";

InfluxQLQuery influxQLQuery    = new InfluxQLQuery(querySqlStr, getDatabase())
            .setPrecision(InfluxQLQuery.InfluxQLPrecision.MILLISECONDS)
            .setRetentionPolicy(policy)
  1. Query
    InfluxQLQueryResult query = influxDB.getInfluxQLQueryApi().query(influxQLQuery);

Expected behavior:
Describe what you expected to happen.
Query results should contain fields(avg, max, min, last) and Tag(user_id),
{"results":[{"series":[{"columns":{"time":0,"avg":1,"max":2,"min":3,"last":4,""},"name":"health_course_heart_rate","values":[{"values":["0","82.59020979020978","107","41","104","xxxxx1"]},{"values":["0","73.34210526315789","87","50","73","xxxxx2"]},{"values":["0","84.04209328782707","108","73","98","xxxxx3"]}]}],"index":0}]}
image

Actual behavior:
Describe What actually happened.
getInfluxQLQueryApi.query() Execution results "InfluxQLQueryResult" no tag column
{"results":[{"series":[{"columns":{"time":0,"avg":1,"max":2,"min":3,"last":4},"name":"health_course_heart_rate","values":[{"values":["0","82.59020979020978","107","41","104"]},{"values":["0","73.34210526315789","87","50","73"]},{"values":["0","84.04209328782707","108","73","98"]}]}],"index":0}]}
image

Specifications:

  • Client Version: influxdb-client-java 6.8.0 , flux-dsl 6.8.0
  • InfluxDB Version: influxdb:1.8.10
  • JDK Version: 11.0.9
  • Platform: Win10
@alespour alespour self-assigned this Jun 20, 2023
@bednar bednar added this to the 6.10.0 milestone Jun 22, 2023
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.

3 participants