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 headers not recognized #11848

Closed
jgranduel opened this issue Aug 6, 2024 · 1 comment · Fixed by #11919
Closed

CSV headers not recognized #11848

jgranduel opened this issue Aug 6, 2024 · 1 comment · Fixed by #11919
Labels
bug Something isn't working

Comments

@jgranduel
Copy link

jgranduel commented Aug 6, 2024

Describe the bug

Giving a new try to datafusion-cli, I followed the first examples in documentation Local Files/Directories:

$ echo "a,b" > data.csv
$ echo "1,2" >> data.csv

then

> datafusion-cli.exe
DataFusion CLI v40.0.0
> select * from './data.csv';
+----------+----------+
| column_1 | column_2 |
+----------+----------+
| a        | b        |
| 1        | 2        |
+----------+----------+
2 row(s) fetched.

I thought the mistake was due to Windows default settings (I set EOL as '\n' without success), then installed datafusion-cli 40.0.0 on WSL with same results. Loading from a directory gave the same results:

> datafusion-cli.exe
DataFusion CLI v40.0.0
> select * from './data_dir/';
+----------+----------+
| column_1 | column_2 |
+----------+----------+
| a        | b        |
| 1        | 2        |
| a        | b        |
| 3        | 4        |
+----------+----------+
4 row(s) fetched.

To Reproduce

see above

Expected behavior

a and b should be headers. Maybe headers could be a defaulted option only.

Additional context

No response

@alamb
Copy link
Contributor

alamb commented Aug 11, 2024

Thank you @jgranduel

@korowa has a doc update here #11919 and I made a proposal to just fix the default config value here #11936 so the example works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants