Hi @Anonymous ,
Thankyou for using Microsoft Q&A platform and thanks for posting your question .
As I understand your query, you are trying to copy data from ADLS to Azure synapse tables using copy activity but the issue is datatype of all csv columns are string .
I assume that you are treating ADLS as the intermediate storage while loading the data from some source like : Azure sql, salesforce, etc? If so, kindly share what is the original source datastore?
Unlike csv files, parquet files are known to preserve the schema of the dataset, that means , it remember what columns are string, numeric etc., so when you re-load your data , from parquet to Azure synapse sql , you can be assured it will look the same as it did when you saved it.
You can use copy data activity to load from parquet to synapse using auto create table.
Note: Using auto create table while loading from parquet to synapse will surely preserve the data type for all columns, however, for varchar and nvarchar columns the default size would be max. If you want to preserve the size as well, you can go for creating external tables from parquet to synapse then loading data from external table to physical table.
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on
or upvote
button whenever the information provided helps you.
Original posters help the community find answers faster by identifying the correct answer. Here is how - Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators