Reputation: 12398
I have a pipeline that copies files from azure datalake to azure SQL
Loops through the output and copies the file into a database table.
A.csv
is copied to dbo.[A]
B.csv
is copied to dbo.[B]
trim
on the column values being copied ?Upvotes: 2
Views: 9785
Reputation: 3838
To apply a trim rule across ALL string columns in a dataset in ADF, use Mapping Data Flows with a column pattern.
In a Derived Column, set your matching rule to "type == 'string'".
In the Column Name, keep it the same using $$.
In the Value, set trim ($$,'...')
Reference docs:
Matching Patterns: https://learn.microsoft.com/en-us/azure/data-factory/concepts-data-flow-column-pattern
Derived Column: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-derived-column
Upvotes: 4
Reputation: 23792
trim
feature is supported by ADF expressions.(link)
e.g.:
trim('!--!wor!ld!', '-!') -> 'wor!ld'
Trims a string of leading and trailing characters. If second parameter is unspecified, it trims whitespace. Else it trims any character specified in the second parameter
Upvotes: 0