hgomez / influxdb

InfluxDB Tools
19 stars 2 forks source link

different sum when importing #1

Closed cpmarvin closed 3 years ago

cpmarvin commented 8 years ago

Hello, @hgomez-sonarsource

I'm getting different values when importing back to influx db.

select sum(bytes) from A = 202850870000 select sum(bytes) from B ( new after import ) = 51243490000

i've tryied with tag and without , same issue. Same issues if i remove /i or not.

java -cp target/influxdb-fetcher-1.0.0-SNAPSHOT.jar com.github.hgomez.influxdb.InfluxDBFetcher http://localhost:8086 x x telegraf1 "SELECT * from A" > A.dump

curl -u x:x-i -POST "http://localhost:8086/write?db=metrics" --data-binary @A.dump

cpmarvin commented 8 years ago

looks like the issues is with timestamp field. from A: 2016-08-08T00:45:02.370294075Z 14000000 2016-08-08T00:45:02.370649259Z 42000000 2016-08-08T00:45:02.370899918Z 70000000 <! 2016-08-08T00:45:02.371160586Z 1290000

in B: 2016-08-08T00:45:02.37Z 70000000 <!

firs two entries from A are lost when importing.

Hope this helps.

hgomez commented 8 years ago

Did you used latest code, I reworked timestamp handling in latest commit (https://github.com/hgomez/influxdb/commit/f951d255b944d7c0bbbb301c3b875f84056a0a7a)