Skip to content

Issue selecting the second column via SQL #9095

Answered by alamb
colbyn asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for the question and report @colbyn

Fascinating. When I changed the data to the following (remove the space in the CSV header) then everything works fine:

--- a/sample.csv
+++ b/sample.csv
@@ -1,4 +1,4 @@
-id, value
+id,value
 0, "Red"
 1, "Blue"
 2, "Green"

Then the reproducer runs great

+----------+
| value    |
+----------+
|  "Red"   |
|  "Blue"  |
|  "Green" |
|  "White" |
|  "Black" |
+----------+

As you have surmized the csv reader is not trimming whitespace on the ,

I looked a little into the CSV reader in arrow and it seems to only permit a single character delimiter (rather than potentially multiple chars , )

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@alamb
Comment options

Comment options

You must be logged in to vote
4 replies
@colbyn
Comment options

@colbyn
Comment options

@alamb
Comment options

@colbyn
Comment options

Answer selected by colbyn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants