turbot / steampipe-plugin-csv

Use SQL to instantly query data from CSV files. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/csv
Apache License 2.0
19 stars 4 forks source link

Poor error message when the folder contains bad CSVs #4

Closed pskrbasu closed 2 years ago

pskrbasu commented 3 years ago

Describe the bug When the paths in the connection config point to a folder that contains one/more invalid/bad CSV files, the plugin returns the following error:

failed to plugin initialise plugin 'steampipe-plugin-csv': TableMapFunc 'PluginTables' had unhandled error: parse error on line 1, column 25: bare " in non-quoted-field

It is hard to understand what's actually wrong from this message IMO.

Steampipe version (steampipe -v) Example: v0.9.0-rc.0

Plugin version (steampipe plugin list) Example: v0.3.0

To reproduce Add a bad CSV file(may contain a bare " somewhere ) to a folder, and add the path to the folder in the connection config. Query a good CSV.

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

vielmetti commented 3 years ago

I'm seeing something that I think might be the same problem - the error message I get is

> select * from csv.woa-projects-2020-11-08
Error: syntax error at or near "-"

which isn't very helpful.

vielmetti commented 3 years ago

I was reminded in Slack that this should have been:

> select * from "csv.woa-projects-2020-11-08"

since Postgres wants funky characters to be double-quoted.

binaek commented 2 years ago

Happens with me as well.

Attaching CSV which are crashing the plugin sample.csv

Happens with empty CSV files as well - but github won't let me upload empty files :-(

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 90 days with no activity.