df_df
September 16, 2022, 7:06am
1
when I use script editer to exec this
import "experimental/csv"
csv.from(url: "https://raw.githubusercontent.com/influxdata/influxdb2-sample-data/master/bird-migration-data/bird-migration.csv")
|> to(bucket:"sample")
always show this error
failed to initialize execute state: could not find bucket "sample"
I have tried many scripts, they are all such errors, also can not find a solution on the Internet,
scott
September 16, 2022, 5:03pm
2
@df_df , you need to create a bucket named “sample” in your InfluxDB instance or update the query to write to a bucket you’ve already created. Just replace "sample"
with an existing bucket name.
df_df
September 19, 2022, 2:38am
3
@scott very thanks,and if show this error how could I can fix it ?
error calling function "from" @10:1-10:67: error calling function "get" @experimental/csv/csv.flux|29:39-29:57: context deadline exceeded
this is my script
import "experimental/csv"
relativeToNow = (tables=<-) =>
tables
|> elapsed()
|> sort(columns: ["_time"], desc: true)
|> cumulativeSum(columns: ["elapsed"])
|> map(fn: (r) => ({ r with _time: time(v: int(v: now()) - (r.elapsed * 1000000000))}))
csv.from(url: "https://influx-testdata.s3.amazonaws.com/noaa.csv")
|> relativeToNow()
|> to(bucket: "test-bucket", org: "test-org")
scott
September 19, 2022, 4:39pm
4
That error essentially means your request to download the CSV is timing out. Are you able to download the CSV file directly?