ADF V2: renaming attributes of Parquet to attributes of target table

Poel van der, RE (Ron) 451 Reputation points
2021-02-08T16:35:38.37+00:00

Hi,

I will simplify my example to make it (at least for myself :) ) more understandable.
I have a dataflow in Azure Data factory V2 which can accept multiple input files, but one at a time.
Each file contains records with logical keys that have to be written to a target table.

Example:
65370-knipsel.jpg

Three files, each with logical keys, but in each file the logical key names are different. Code and Type or Name and Type etc.
In the target table the names of these fields are Code_1 and Number_1

How can I , in a generic way, always rename the attributes of the Parquet to those of the target table?

Probably in a derived column activity, but I dont know how
Hope somenone can help

Thnx in advance
Ron

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,988 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nasreen Akter 10,801 Reputation points
    2021-02-08T19:38:35.053+00:00

    Hi @Poel van der, RE (Ron) ,

    Thank you for asking this question. To achieve this, you have to do the following (please see the screenshots for details):

    1. Create Dataset with empty schema or For existing Dataset, clear the schema
    2. Derived columns based on the fields you required e.g., Code_1: toString(coalesce(toString(byName('Code')), toString(byName('Name')), toString(byName('Extract_Code')))) Number_1: toString(coalesce(toString(byName('Type')), toString(byName('Number'))))
    3. Map fields in the Sink

    65482-dataset-20210208.jpg
    65478-derivedcols-20210208.jpg
    65510-code-1.jpg
    65458-number-1.jpg
    65483-sink-20210208.jpg

    Hope this helps. Thanks!

    ----------

    If the above response helps, please "accept as answer" and "up-vote" it. Thanks!

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Poel van der, RE (Ron) 451 Reputation points
    2021-02-09T13:24:21.93+00:00

    HI @Nasreen Akter

    it works, thnx very much

    Regards
    Ron


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.