hgomez / influxdb

InfluxDB Tools
19 stars 2 forks source link

Is this tool support influxDb v.2 ? #15

Closed Dhyanesh97 closed 3 years ago

Dhyanesh97 commented 3 years ago

I was trying to use this tool to convert field to tag but it was failing with the java exception for influxdb 2.0.

$ influxdb-fetcher \
>     http://xx.xxx.xxx.xx:8086 username password bucket\
>     "SELECT * FROM cu_om GROUP BY FriendlyName LIMIT 100" \
>     vendorName

Exception:

File ‘/var/tmp/influxdb-fetcher-1.0.3.jar’ already there; not retrieving.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by retrofit2.Platform (file:/var/tmp/influxdb-fetcher-1.0.3.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.UnsupportedOperationException: MessagePack format is only supported from InfluxDB version 1.4 and later
        at org.influxdb.impl.InfluxDBImpl.executeQuery(InfluxDBImpl.java:820)
        at org.influxdb.impl.InfluxDBImpl.query(InfluxDBImpl.java:559)
        at com.github.hgomez.influxdb.InfluxDBFetcher.main(InfluxDBFetcher.java:68)

Is there any workaround ? Please any help appreciated

hgomez commented 3 years ago

Hi

I don't understand how you have retrofit2 error

Dhyanesh97 commented 3 years ago

Hello,

I followed the setup instructions in README.md file and then executed the above mentioned command to convert field to tag.

wget --no-clobber --output-document=/usr/local/bin/influxdb-fetcher https://raw.githubusercontent.com/hgomez/influxdb/master/bin/influxdb-fetcher
chmod +x /usr/local/bin/influxdb-fetcher

I am using openjdk 11.0.11.

System specification: NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

hgomez commented 3 years ago

Retrofit2 is bundled in influxdb-java library which only support InfluxDB v1

https://github.com/influxdata/influxdb-java/blob/master/pom.xml#L280-L282

For InfluxDB 2 support, we should use another library

https://github.com/influxdata/influxdb-client-java

PR welcomed

amotl commented 3 years ago

Dear @Dhyanesh97,

we are already tracking this on behalf of #6. As Henri said, a patch for bringing in support for InfluxDB 2 would be much appreciated.

With kind regards, Andreas.