Reputation: 441
How can we add headers to the files existing in the blob/ azure data lake using azure data factory. I am using a copy activity to move the header less files to the sink, but while moving the files should have default headers like "Prop_0" or "Column_1". Any method available to achieve the same?
Any help would be appreciated. Thanks and Regards, Sandeep
Upvotes: 2
Views: 6870
Reputation: 1245
I tried a different solution. Used the 'no delimiter' option to keep all of them as one column. Then, In the derived column action, I split the single column into multiple columns and provided a proper name for each column. Now we can map the columns into the target table.
Upvotes: 0
Reputation: 78
In ADF, create a new Data Flow. Add your CSV source with a no header dataset. Then add your Sink with a dataset that writes to ADLS G2 folder as a text delimited file WITH headers. In the Sink Mapping, you can name your columns:
Upvotes: 0
Reputation: 16401
In usually, Data factory will using the default header Prop_0, Prop_1...Prop_N
for the less header csv file to help us copy the data, if we don't set the first row as header
.
This is to help us do the column mapping but won't change the csv file.
According my experience and know about Data Factory, it doesn't support us do the schema change of the csv file. It's impossible to add the header of the csv files at least for now.
Hope this helps
Upvotes: 0