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

CSV Column Name not recognized #277

Open
neoramos opened this issue Apr 17, 2024 · 1 comment
Open

CSV Column Name not recognized #277

neoramos opened this issue Apr 17, 2024 · 1 comment

Comments

@neoramos
Copy link

neoramos commented Apr 17, 2024

I'm not sure what I'm doing wrong.

I'm trying to read from a csv with the columns Engine_name, Variable_name and Value.
However, for some reason the Engine_name column is not recognized as a header column.
Here are the queries I tried:
Get some of in on the data to confirm the data is there: trdsql -ih -a mysql_5.7.x_settings.csv
Output:
The table name is mysql_5.7.x_settings.csv.
The file type is CSV.

Data types:
+-------------------+------+
| column name | type |
+-------------------+------+
| `Engine_name` | text |
| `Variable_name` | text |
| `Value` | text |
+-------------------+------+

Data samples:
+-----------------+---------------------------------------+-------------------------------+
| `Engine_name` | `Variable_name` | `Value` |
+-----------------+---------------------------------------+-------------------------------+
| MySQL 5.7.X | aurora_backtrace_compare_metrics_file | backtrace_compare_metrics.txt |
+-----------------+---------------------------------------+-------------------------------+

Examples:
trdsql -ih "SELECT `Engine_name`, `Variable_name`, `Value` FROM mysql_5.7.x_settings.csv"
trdsql -ih "SELECT `Engine_name`, `Variable_name`, `Value` FROM mysql_5.7.x_settings.csv WHERE `Engine_name` = 'MySQL 5.7.X'"
trdsql -ih "SELECT `Engine_name`, count(`Engine_name`) FROM mysql_5.7.x_settings.csv GROUP BY `Engine_name`"
trdsql -ih "SELECT `Engine_name`, `Variable_name`, `Value` FROM mysql_5.7.x_settings.csv ORDER BY `Engine_name` LIMIT 10"

I tried:
trdsql -ih "SELECT `Engine_name`, `Variable_name`, `Value` FROM mysql_5.7.x_settings.csv ORDER BY `Engine_name` LIMIT 10"
2024/04/17 09:29:08 export: no such column: Engine_name [SELECT Engine_name, Variable_name, Value FROM mysql_5.7.x_settings.csv ORDER BY Engine_name LIMIT 10]

I tried:
trdsql -ih "SELECT Engine_name, Variable_name, Value FROM mysql_5.7.x_settings.csv"
2024/04/17 09:29:27 export: no such column: Engine_name [SELECT Engine_name, Variable_name, Value FROM mysql_5.7.x_settings.csv]

Btw, great job on this tool. I just started using and sharing it internally.

@noborus
Copy link
Owner

noborus commented Apr 17, 2024

Thank you for writing the issue.

I tried doing the same thing, but it didn't reproduce.

trdsql -ih "SELECT Engine_name, Variable_name, Value FROM mysql_5.7.x_settings.csv" 
MySQL 5.7.X, aurora_backtrace_compare_metrics_file, backtrace_compare_metrics.txt

You may be able to find the cause by running it with -debug.

trdsql -debug -ih "SELECT Engine_name, Variable_name, Value FROM mysql_5.7.x_settings.csv" 

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

2 participants