Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

influx write with seperator does not work as without #517

Open
DanielHabenicht opened this issue Jun 15, 2023 · 0 comments
Open

influx write with seperator does not work as without #517

DanielHabenicht opened this issue Jun 15, 2023 · 0 comments

Comments

@DanielHabenicht
Copy link

DanielHabenicht commented Jun 15, 2023

The Example given in influxdb for csv import via CLI is as following, but executing the same commands with a different seperator produces errors.
image

By the way: There is a typo in dataTime, it should be dateTime

Reproduction:

> influx version
Influx CLI 2.6.1 (git: 61c5b4d) build_date: 2022-12-29T15:41:09Z
> cat <<EOF > test.csv
date,sighted,loc
2020-01-01,12,Boise
2020-06-01,78,Boise
2020-01-01,54,Seattle
2020-06-01,112,Seattle
2020-01-01,9,Detroit
2020-06-01,135,Detroit
EOF
> influx write dryrun -b test   -f test.csv --header "#constant measurement,birds"   --header "#datatype dateTime:2006-01-02,long,tag"

birds,loc=Boise sighted=12i 1577836800000000000
birds,loc=Boise sighted=78i 1590969600000000000
birds,loc=Seattle sighted=54i 1577836800000000000
birds,loc=Seattle sighted=112i 1590969600000000000
birds,loc=Detroit sighted=9i 1577836800000000000
birds,loc=Detroit sighted=135i 1590969600000000000
> sed -i "s/,/;/g" test.csv
> influx write dryrun -b test -f test.csv --header "sep=;" --header "#constant measurement,birds" --header "#datatype dateTime:2006-01-02,long,tag"

2023/06/15 13:24:48 line 5: no measurement column found
2023/06/15 13:24:48 line 6: no measurement column found
2023/06/15 13:24:48 Unable to batcher to error-file: invalid argument
2023/06/15 13:24:48 line 7: no measurement column found
2023/06/15 13:24:48 Unable to batcher to error-file: invalid argument
2023/06/15 13:24:48 line 8: no measurement column found
2023/06/15 13:24:48 Unable to batcher to error-file: invalid argument
2023/06/15 13:24:48 line 9: no measurement column found
2023/06/15 13:24:48 Unable to batcher to error-file: invalid argument
2023/06/15 13:24:48 line 10: no measurement column found
2023/06/15 13:24:48 Unable to batcher to error-file: invalid argument

Another thing that came to my mind while trying to import big files is that influx write dryrun would greatly benefit from a --head or --max-lines <n> option. This way one could try the annotated header without the console exploding. (but thats probably a feature request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant