frictionlesspulley
frictionlesspulley

Reputation: 12398

apply trim before copy using azure data factory

I have a pipeline that copies files from azure datalake to azure SQL

Get Meta Data and Copy in a For Each Loop

Question

Upvotes: 2

Views: 9785

Answers (2)

Mark Kromer MSFT
Mark Kromer MSFT

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

Jay Gong
Jay Gong

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

Related Questions