@Anonymous Thanks for using Microsoft Q&A forum and posting your query.
I see 2 questions being asked in this thread:
- Problem 1: Column name issue with auto/default mapping from CSV to parquet/AVRO format
- Problem 2: JSON multi-level source not being flattened with dynamic mapping.
To keep it clean and clear for other reader of the community let's focus on problem 1 in this thread and I would request you to please open a new thread for problem 2 as both are different contexts. Just wanted to keep the issue distinct from each other and avoid confusion to the community :).
Regarding Problem 1, yes, it is an expected behavior when there are special characters or space in the column names, when you do explicit mapping, it succeeds as you are explicitly stating the mapping of the source to sink columns. But when you try to do auto/default mapping, ADF throws an error as it is unable to correlate the source to sink column names. For default mapping, copy activity maps source data to sink by column names in case-sensitive manner. Since there is a change in column names (space/special characters) of your source, it is throwing the error.
To overcome this issue, you will have to go with parameterized mapping (where you predefine the mapping json and pass it to copy activity dynamically at runtime) or dynamic mapping as explained in the below blog post a community volunteer.
Please refer to below for details about the implementation of the workarounds:
- Parameterized Column mapping in Copy Activity in Azure Data Factory
- Blog post: How to: Copy delimited files having column names with spaces in parquet format using ADF - This blog post explained exactly the same problem you are facing and a possible solution on how to over come it.
- Another blog post: Export Parquet Files with Column Names with Spaces
In addition, a note has been called out in the public documentation (Parquet format) that "White space in column name is not supported for Parquet files."
Hope this info helps.
Please don’t forget to Accept Answer
and Yes
for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.