Cannot import CSVs with unix timestamps

Hi there,
I try to migrate a huge collection of measurement data from MySQL to InfluxDB. Therefore measurement data is exported as csv and annotations are added.

But when CSV file is imported in InfluxDB, timestamps cannot be parsed. When submitting the import query the following error is thrown:
error in csv.from(): parsing time "1577836800000000000" as "number": cannot parse "1577836800000000000" as "number"

Column annotation is set to dateTime:number
I even tried it with the sample number from the influx docs: https://docs.influxdata.com/influxdb/v2.0/reference/syntax/annotated-csv/extended/#datetime

Am I missing something? Or is this.a bug?

This is my query:
import "experimental/csv" csv.from(url: "http://192.168.0.90:8000/test.csv") |> to(bucket: "test", org: "sample-org")

This is my test CSV:
#group,false,false,false,false,true,true,true #datatype,string,long,dateTime:number,double,string,string,string #default,_result,,,,,, ,result,table,_timestamp,_value,_field,_measurement,location ,,0,1577836800000000000,82,degrees,average_temperature,coyote_creek ,,0,1533064202000000000,73,degrees,average_temperature,coyote_creek ,,0,1533065401000000000,89,degrees,average_temperature,coyote_creek ,,0,1577836810000000000,86,degrees,average_temperature,coyote_creek ,,0,1533066002000000000,77,degrees,average_temperature,coyote_creek ,,0,1533066602000000000,70,degrees,average_temperature,coyote_creek ,,0,1533067201000000000,84,degrees,average_temperature,coyote_creek ,,0,1533067802000000000,76,degrees,average_temperature,coyote_creek ,,0,1533068402000000000,85,degrees,average_temperature,coyote_creek ,,0,1533069001000000000,80,degrees,average_temperature,coyote_creek ,,0,1533069602000000000,70,degrees,average_temperature,coyote_creek ,,,,,,,

1 Like

Hello,

I am having the exact same issue. Did you find a solution?

Thank you

No.
I had to write a script that converts the timestamp before import.

1 Like