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

Java client: SHOW SERIES return empty result #684

Closed
marcinkoziarz opened this issue Feb 14, 2024 · 1 comment · Fixed by #704
Closed

Java client: SHOW SERIES return empty result #684

marcinkoziarz opened this issue Feb 14, 2024 · 1 comment · Fixed by #704
Assignees
Milestone

Comments

@marcinkoziarz
Copy link

marcinkoziarz commented Feb 14, 2024

Hi,
During implementation of tool that needs to retrieve schema of InfluxDB 2.7, I have encountered issue where show series return empty result, although underlying CSV contains correct data.

Data retrieved underneath as CSV is in format (note that two columns are empty!):

name,tags,key
,,temperature
,,pressure

I believe issue is in line https://github.com/influxdata/influxdb-client-java/blob/master/client/src/main/java/com/influxdb/client/internal/InfluxQLQueryApiImpl.java#L129 where last line of CSV is detected incorrectly, and instead of

if (csvRecord.size() == 1 || csvRecord.get(0).equals("")) {

it should be

if (csvRecord.size() == 1 && csvRecord.get(0).equals("")) {

Steps to reproduce:

  1. Run InfluxQLQueryResult result = client.getInfluxQLQueryApi().query(new InfluxQLQuery("SHOW SERIES", "mydb"));
  2. Observe that result.getResults().size() == 1, but result.getResults().get(0).getSeries().size() == 0

Expected behavior:
Object InfluxQLQueryResult should contain list of series retrieved from InfluxDB, as running SHOW SERIES from command line does it.

Actual behavior:
First result from InfluxQLQueryResult has no series parsed from InfluxDB query response.

Specifications:

  • Client Version: 7.0.0
  • InfluxDB Version: 2.7.0
  • JDK Version: openjdk version "17.0.8.1" 2023-08-24
  • Platform: Linux (Arch)
@bednar bednar assigned alespour and karel-rehor and unassigned alespour Apr 15, 2024
@karel-rehor karel-rehor mentioned this issue Apr 18, 2024
6 tasks
@karel-rehor
Copy link
Contributor

@marcinkoziarz

Thanks for this report. This should be fixed in PR #704.

karel-rehor added a commit that referenced this issue Apr 19, 2024
* fix: issue #684 - SHOW SERIES and other results with empty name or tags fields

* doc: update CHANGELOG.md

* test: separate SHOW SERIES data into targeted test
@bednar bednar added this to the 7.1.0 milestone Apr 19, 2024
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.

4 participants