Reading timestamp "Cannot convert String to Long"
When writing into influxDB, I provided a long as Timestamp
Point.measurement(/**/).time(observation.getTimestamp(), TimeUnit.MILLISECONDS).(/**/)
However, when I read the Point back I find a formatted String
2015-07-03T09:34:25.714Z
and not the long as I would expect.
(Of course I get a Cast exception when trying to initialize my Pojo)
Is this wanted?
Also, milliseconds are not padded
2015-07-03T09:34:27.799Z
2015-07-03T09:34:27.79Z
2015-07-03T09:34:27.8Z
hence even parsing the String against the format yyyy-MM-dd'T'HH:mm:ssz with SimpleDateFormat isn't a viable solution.
Hi @andremann
according to: https://influxdb.com/docs/v0.9/guides/querying_data.html
Timestamp format defaults to the format you see. It can be otoh configured with the epoch="s,ms,m,h," argument for the query. This is not yet implemented.
This can for example be implemented in a second api signature query(String query, TimeUnit unit)
Greetings Stefan
I'm also waiting for this feature as the only acceptable choice for me is timestamp long
I implemented a new method query(String query, Timeunit unit) which acts as described above. This is only compile tested, so please test if this is what solves your problem.
Greetings Stefan
Worked for me, thanks