Newline in column names after importing a CSV #11973
-
I imported a large CSV file into DuckDB and then realized that many column names have newline (\n) characters. Some even have question mark (?) and apostrophe ('). Here is the output of the DESCRIBE table query (in JSON mode so you can see exact characters):
I am not able to refer to these columns in a SELECT query at all (using DuckDB CLI). To isolate the problem, I restricted to just one column whose name includes \n:
How do I escape my query so that this column can actually be read? If this is not possible, shouldn't DuckDB have cleaned up the column names and stripped invalid characters while importing the CSV? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I have confirmed that DBeaver's DuckDB driver has the same issue. While |
Beta Was this translation helpful? Give feedback.
-
There is a |
Beta Was this translation helpful? Give feedback.
There is a
normalize_names
option to the CSV import which I think fixes problems like thisWe don't do this automatically