'Keep Sink Columns in Copy Activity when Source Columns less than Sink Columns

I have a copy activity in Datafactory that dynamically maps the columns between files in tables A and B. Both tables, A and B are .parquet. Table A has 8 columns, and these 8 columns are mapped using a mappings json variable to 8 of the 12 Columns in table B. This json is a the output of an activity that creates the mappings variable to be consumed in the copy activity. However, when I run the pipeline, all mappings work fine but the non mapped columns originally in sink (4) - disappear. Is there a way to preserve these columns in the activity and keep them unchanged ?

The desired output would be the sink table B with the same 12 columns, 8 of those with the data that was copied in the activity and the last 4 should be kept NULL.



Solution 1:[1]

You can use DataFlow Activity. In Derived column’s settings Select Columns. Here select unmapped columns.

In the sink do the required mapping.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AbhishekKhandave-MT