Forum Discussion
Schema Mapping on Parametrized Copy Data
- 6 months ago
Thanks for reaching out to the Microsoft Fabric Community.
In a parametrized Copy activity inside a ForEach loop, leaving schema mapping empty allows auto creation only if the destination table does not already exist in the Lakehouse.
The error:
SourceColumnIsNotDefinedInDeltaMetadata
typically means the table already exists, but its Delta metadata does not include that column. Copy activity validates against the existing schema and does not automatically evolve it.
Please check:
->Whether the destination table already exists
->If it exists, whether the bflag2 column is present
->Whether the source schema changed after the initial loadRe importing schema in the Copy activity can help ensure the latest structure is reflected, but it does not update the metadata of an existing Delta table.
If the schema has changed, you can test dropping the table before the Copy runs or using overwrite.
For dynamic multi table ingestion, you may also consider Dataflow Gen2 with automatic schema settings enabled, or a Notebook based approach, which provides more control over table creation and schema handling.
Similar threads and useful resources for reference:
Solved: Re: Fabric Issue - Microsoft Fabric Community
Copying delta table from one lakehouse to another:... - Microsoft Fabric Community
Configure Lakehouse in a copy activity - Microsoft Fabric | Microsoft Learn
Hope this helps. Please reach out for further assistance.
Thank you. - 6 months ago
Hi david_avgarcia,
The schema mapping cannot be empty, but it can be dynamic. The way I've handled this before is to have a json object with the schema mapping details passed in as a parameter, and then use that in the schema mapping page as dynamic content.
Here's a great video on how to do this: Master Dynamic Data Mapping in Microsoft Fabric Data Pipelines
Hi david_avgarcia,
The schema mapping cannot be empty, but it can be dynamic. The way I've handled this before is to have a json object with the schema mapping details passed in as a parameter, and then use that in the schema mapping page as dynamic content.
Here's a great video on how to do this: Master Dynamic Data Mapping in Microsoft Fabric Data Pipelines
Although it will be nice a dynamic auto mappings feature, this works, thank you!!