Influx csv uploading issue

Hey Team,

I am trying to upload one csv file into influxDB with csv upload section but getting error.
I am trying continuously but agian and agian getting error.

timestamp,imbalanced_prop_metric,motor_failure_mask,fd_roll,fd_pitch,fd_alt,fd_ext,fd_arm_escs,fd_battery,fd_imbalanced_prop,fd_motor
3268000,0.0008987406,0,0,0,0,0,0,0,0,0
3724000,0.0007667749,0,0,0,0,0,0,0,0,0
4156000,0.00059393386,0,0,0,0,0,0,0,0,0
4660000,0.00052776595,0,0,0,0,0,0,0,0,0
5164000,0.00025773933,0,0,0,0,0,0,0,0,0
5668000,0.00019762486,0,0,0,0,0,0,0,0,0
5776000,0.00020719941,0,0,0,0,0,0,0,0,0
6280000,0.00017843458,0,0,0,0,0,0,0,0,0
6784000,-1.0996082e-06,0,0,0,0,0,0,0,0,0
7288000,0.00031360707,0,0,0,0,0,0,0,0,0
7792000,0.000233208,0,0,0,0,0,0,0,0,0
8296000,0.00024180397,0,0,0,0,0,0,0,0,0
8800000,0.00023915694,0,0,0,0,0,0,0,0,0
9256000,0.00020273756,0,0,0,0,0,0,0,0,0
9268000,0.00020273756,0,0,0,0,0,0,0,0,0
9772000,0.00014499205,0,0,0,0,0,0,0,0,0
10276000,-8.8391294e-05,0,0,0,0,0,0,0,0,0
10780000,-0.0004136227,0,0,0,0,0,0,0,0,0
11284000,-0.00016335951,0,0,0,0,0,0,0,0,0
11788000,-6.853168e-05,0,0,0,0,0,0,0,0,0
12292000,-3.8955957e-05,0,0,0,0,0,0,0,0,0
12796000,-0.00031308562,0,0,0,0,0,0,0,0,0
13300000,-0.0027321465,0,0,0,0,0,0,0,0,0
13804000,-0.012747452,0,0,0,0,0,0,0,0,0
14308000,-0.012371383,0,0,0,0,0,0,0,0,0
14812000,-0.02023043,0,0,0,0,0,0,0,0,0
15316000,-0.01949761,0,0,0,0,0,0,0,0,0
15532000,-0.019022018,0,0,0,0,0,0,0,0,0
16036000,-0.0274005,0,0,0,0,0,0,0,0,0
16540000,-0.031292226,0,0,0,0,0,0,0,0,0
17044000,-0.028818734,0,0,0,0,0,0,0,0,0

this is actual data and at first time uploading getting error like Failed to upload the selected CSV: error in csv.from(): failed to read metadata: missing expected annotation default so change someting and current csv file is look like below

#group,false,true,true,true,true,true,true,true,true,true,true,true
#datatype,long,string,long,double,long,long,long,long,long,long,long,long
#default,mean,

_table_id,_measurement,timestamp,imbalanced_prop_metric,motor_failure_mask,fd_roll,fd_pitch,fd_alt,fd_ext,fd_arm_escs,fd_battery,fd_imbalanced_prop,fd_motor
,ftms,3268000,0.0008987406,0,0,0,0,0,0,0,0,0
,ftms,3724000,0.0007667749,0,0,0,0,0,0,0,0,0
,ftms,4156000,0.00059393386,0,0,0,0,0,0,0,0,0
,ftms,4660000,0.00052776595,0,0,0,0,0,0,0,0,0
,ftms,5164000,0.00025773933,0,0,0,0,0,0,0,0,0
,ftms,5668000,0.00019762486,0,0,0,0,0,0,0,0,0
,ftms,5776000,0.00020719941,0,0,0,0,0,0,0,0,0
,ftms,6280000,0.00017843458,0,0,0,0,0,0,0,0,0
,ftms,6784000,-1.0996082e-06,0,0,0,0,0,0,0,0,0
,ftms,7288000,0.00031360707,0,0,0,0,0,0,0,0,0
,ftms,7792000,0.000233208,0,0,0,0,0,0,0,0,0
,ftms,8296000,0.00024180397,0,0,0,0,0,0,0,0,0
,ftms,8800000,0.00023915694,0,0,0,0,0,0,0,0,0
,ftms,9256000,0.00020273756,0,0,0,0,0,0,0,0,0
,ftms,9268000,0.00020273756,0,0,0,0,0,0,0,0,0
,ftms,9772000,0.00014499205,0,0,0,0,0,0,0,0,0
,ftms,10276000,-8.8391294e-05,0,0,0,0,0,0,0,0,0
,ftms,10780000,-0.0004136227,0,0,0,0,0,0,0,0,0
,ftms,11284000,-0.00016335951,0,0,0,0,0,0,0,0,0
,ftms,11788000,-6.853168e-05,0,0,0,0,0,0,0,0,0
,ftms,12292000,-3.8955957e-05,0,0,0,0,0,0,0,0,0
,ftms,12796000,-0.00031308562,0,0,0,0,0,0,0,0,0
,ftms,13300000,-0.0027321465,0,0,0,0,0,0,0,0,0
,ftms,13804000,-0.012747452,0,0,0,0,0,0,0,0,0
,ftms,14308000,-0.012371383,0,0,0,0,0,0,0,0,0
,ftms,14812000,-0.02023043,0,0,0,0,0,0,0,0,0
,ftms,15316000,-0.01949761,0,0,0,0,0,0,0,0,0
,ftms,15532000,-0.019022018,0,0,0,0,0,0,0,0,0

but again n again getting error like Failed to upload the selected CSV: error in csv.from(): missing table ID or Failed to upload the selected CSV: error in csv.from(): strconv.ParseInt: parsing “0.0008987406”: invalid syntax.

Any one please help what is the proper annotation for my actual data.

Any support will be appreciated.

Thanks

@Abhishek The CSV uploader in the InfluxDB UI expects CSV to be annotated CSV formatted as it is returned from the query API. It requires certain columns with certain values and timestamps must be RFC3339 timestamps. It is VERY picky and can be hard to work with.

There are two paths you can go down:

  • Reformat all the data in the CSV to be what the CSV uploader expects (correct annotations as shown here, RFC3339 timestamps, etc.)
  • In the data explorer, you can actually write and run a query that uses csv.from with mode: "raw" to load the CSV data with all columns as strings. You can then use map() to cast each column to it’s correct type and then write the data to a bucket. For example:
import "csv"
import "influxdata/influxdb"

csvData = "timestamp,imbalanced_prop_metric,motor_failure_mask,fd_roll,fd_pitch,fd_alt,fd_ext,fd_arm_escs,fd_battery,fd_imbalanced_prop,fd_motor
3268000,0.0008987406,0,0,0,0,0,0,0,0,0
3724000,0.0007667749,0,0,0,0,0,0,0,0,0
"

from.csv(csv: csvData, mode: "raw")
    |> map(fn: (r) => ({
        _measurement: "ftms",
        _time: time(v: int(v: r.timestamp) * 100000000000),
        imbalanced_prop_metric: float(v: r.imbalanced_prop_metric),
        motor_failure_mask: int(v: r.motor_failure_mask),
        fd_roll: int(v: r.fd_roll),
        fd_pitch: int(v: r.fd_pitch),
        fd_alt: int(v: r.fd_alt),
        fd_ext: int(v: r.fd_ext),
        fd_arm_escs: int(v: r.fd_arm_escs),
        fd_battery: int(v: r.fd_battery),
        fd_imbalanced_prop: int(v: r.fd_imbalanced_prop),
        fd_motor: int(v: r.fd_motor),
    }))
    |> influxdb.wideTo(bucket: "example-bucket")

Note: time() parses integers as nanosecond timestamps so I had to convert your integer timestamps to nanosecond precision. What precision are your timestamps? When using what I assumed was the correct conversion, the timestamps are from 1980.