
Answer-first summary for fast verification
Answer: flatten
## Explanation When working with JSON data containing nested arrays in Azure Data Factory mapping data flows, the **Flatten transformation** is specifically designed to handle this exact scenario. ### Why Flatten Transformation is Optimal: - **Purpose-Built for Nested Arrays**: The Flatten transformation is explicitly designed to unpack nested arrays and create separate rows for each element within those arrays. - **Preserves Parent Context**: When flattening nested arrays, the transformation maintains the parent object's fields while creating individual rows for each array element, ensuring no data loss from the hierarchical structure. - **JSON-Specific Handling**: The Flatten transformation has built-in capabilities to parse JSON structures and properly extract array elements into tabular format. - **Efficient Data Processing**: It efficiently processes the hierarchical JSON data and converts it into a flat, relational structure suitable for downstream analytics and storage. ### Why Other Options Are Less Suitable: - **New Branch**: Creates parallel data streams but doesn't flatten nested structures - it duplicates the entire data flow path. - **Unpivot**: Transforms columns into rows but is designed for pivoted data tables, not for handling nested JSON arrays. - **Alter Row**: Used for conditional row modifications (insert, update, delete, upsert) but doesn't handle structural transformations of nested data. The Flatten transformation directly addresses the requirement to create "one row for each item in the arrays" from JSON objects with nested arrays, making it the most appropriate choice for this data transformation scenario.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are creating an Azure Data Factory pipeline with a mapping data flow. Your source data is in JSON format and contains objects with nested arrays. You need to flatten this data into a tabular structure where each element within the arrays becomes a separate row.
Which data flow transformation should you use?
A
new branch
B
unpivot
C
alter row
D
flatten