I have a csv file
Customer,Gender,Age,City
1,Male,23,Chennai
4,Female,34,Madurai
3,Male,23,Bangalore
My Azure SQL DB's table TAB_A has only one column: Column_Name I need to move the header of csv file into TAB_A such that the result is:
Column_Name
Customer
Gender
Age
City
Is it possible to achieve this functionality with ADF - Mapping Data flow without using Databricks/Python.
I tried with Source - Surrogate Key - Filter. Able to extract header as row. Unable to transpose. Any pointers? Thanks.
I created a simple test and successfully inserted the header into the sql table.
I created a test.csv file, set it as source data, unselect First row as header
.
Source data preview is as follows:
Use SurrogateKey1 activity to generate a Row_No column. SurrogateKey1 activity data preview is as follows:
Use FIlter1 activity to filter header via expression Row_No == 1
. Data preview is as follows:
UseUnpivot1 activity to perform row-column conversion.
Ungroup by Row_No
.
Unpivot key: just fill in a column name.
Unpivoted columns: This column name must be consistent with the column name in your sql table. This way ADF will do automatic mapping.
Data preview is as follows:
That's all.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.