AWS Glue DataBrew NEST_TO_MAP Transformation

Answer Correct answer: B — Use AWS Glue DataBrew to read the files. Use the NEST_TO_MAP transformation to create the new column.

A company receives .csv files that contain physical address data. The data is in columns that have the following names: Door_No, Street_Name, City, and Zip_Code. The company wants to create a single column to store these values in the following format: Which solution will meet this requirement with the LEAST coding effort? - image

  1. Use AWS Glue DataBrew to read the files. Use the NEST_TO_ARRAY transformation to create the new column.
  2. Use AWS Glue DataBrew to read the files. Use the NEST_TO_MAP transformation to create the new column. Correct Answer
  3. Use AWS Glue DataBrew to read the files. Use the PIVOT transformation to create the new column.
  4. Write a Lambda function in Python to read the files. Use the Python data dictionary type to create the new column.

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The key insight is distinguishing between NEST_TO_ARRAY (which creates an ordered list of objects) and NEST_TO_MAP (which creates a key-value JSON object), as the target format requires key-value pairs.

This question tests the use of AWS Glue DataBrew's NEST_TO_MAP transformation to consolidate multiple columns into a single JSON object with minimal coding.

Many learners choose Option A (NEST_TO_ARRAY) because they focus on the square brackets in the example image, failing to recognize that the content inside represents key-value pairs rather than a simple array of values.

Community Discussion (6 comments)

FuriouZ 👍 12 Selected: B
NEST_TO_ARRAY would result in: [ {"key": "key1", "value": "value1"}, {"key": "key2", "value": "value2"}, {"key": "key3", "value": "value3"}] while NEST_TO_MAP results: { "key1": "value1", "key2": "value2", "key3": "value3" } Therefore go with B
pypelyncar 👍 3 Selected: B
The NEST_TO_MAP transformation is specifically designed to convert data from nested structures (like rows in a CSV) into key-value pairs, perfectly matching the requirement of creating a new column with address components as key-value pairs
Ousseyni 👍 4 Selected: B
AWS Glue DataBrew is a visual data preparation tool that allows for easy transformation of data without requiring extensive coding. The NEST_TO_MAP transformation in DataBrew allows you to convert columns into a JSON map, which aligns with the desired JSON format for the address data.
GiorgioGss 👍 1 Selected: A
Come on guys. That's and array there so...
kj07 👍 2
Option B: NEST_TO_MAP: Converts user-selected columns into key-value pairs, each with a key representing the column name and a value representing the row value. The order of the selected column is not maintained while creating the resultant map. The different column data types are typecast to a common type that supports the data types of all columns. https://docs.aws.amazon.com/databrew/latest/dg/recipe-actions.NEST_TO_MAP.html PIVOT: Converts all the row values in a selected column into individual columns with values. NEST_TO_ARRAY: Converts user-selected columns into array values. The order of the selected columns is maintained while creating the resultant array. The different column data types are typecast to a common type that supports the data types of all columns.
damaldon 👍 1
Ans. A NEST_TO_ARRAY Converts user-selected columns into array values. The order of the selected columns is maintained while creating the resultant array. https://docs.aws.amazon.com/databrew/latest/dg/recipe-actions.NEST_TO_ARRAY.html

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option B is correct because the required output is a JSON object where each address component (Door_No, Street_Name, etc.) serves as a key and its value is the corresponding data. The NEST_TO_MAP transformation in AWS Glue DataBrew specifically converts selected columns into a map (JSON object) with key-value pairs, which matches the desired structure {"Door_No": "123",...}. This requires zero custom code, satisfying the 'least coding effort' constraint.

Why the Other Options Are Wrong

Option A (NEST_TO_ARRAY) produces an array of objects like [{"key": "Door_No", "value": "123"}], which does not match the flat key-value JSON object shown in the prompt. Option C (PIVOT) rotates column headers into row values or vice versa, which is unrelated to creating a nested JSON structure from existing columns. Option D involves writing Python code in Lambda, which violates the 'least coding effort' requirement compared to using a visual tool like DataBrew.

Community Comment Notes

The community largely agreed on Option B. As user FuriouZ noted, "NEST_TO_ARRAY would result in: [ {"key": "key1", "value": "value1"}...] while NEST_TO_MAP results: { "key1": "value1"...}". User Ousseyni correctly identified that DataBrew allows easy transformation without extensive coding. Although some users like GiorgioGss argued for A due to the visual appearance of brackets, the internal structure is clearly a map, not an array of primitives.

Official Reference

Exam Strategy

When asked for 'least coding effort', prioritize managed services with visual interfaces or built-in transformations over custom scripting. Always inspect the exact data structure requested; if it looks like a dictionary or JSON object with keys, look for MAP-based transformations.

Frequently Asked Questions

What is the difference between NEST_TO_ARRAY and NEST_TO_MAP in DataBrew?

NEST_TO_ARRAY creates an ordered list of key-value objects, while NEST_TO_MAP creates a single JSON object (map) where columns become keys and values.

Why is PIVOT not suitable for this task?

PIVOT is used to rotate column headers into rows or vice versa, not to combine multiple columns into a single nested JSON structure.

More DEA-C01 FAQ →

Related Analysis

Practice All DEA-C01 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DEA-C01 Practice Test →

← Back to DEA-C01 Study Guide