
Answer-first summary for fast verification
Answer: Use AWS Glue DataBrew to read the files. Use the NEST_TO_MAP transformation to create the new column.
Using the NEST_TO_MAP transformation in AWS Glue DataBrew is the most straightforward and least coding-intensive way to combine multiple columns into a single map (JSON-like) column. This perfectly addresses the requirement with minimal effort compared to custom Python scripts.
Author: Ritesh Yadav
Ultimate access to all questions.
No comments yet.
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:
{"Door_No":"24", "Street_Name":"AAA street", "City": "BBB", "Zip_Code":"11111"}
Which solution will meet this requirement with the LEAST coding effort?
A
Use AWS Glue DataBrew to read the files. Use the NEST_TO_ARRAY transformation to create the new column.
B
Use AWS Glue DataBrew to read the files. Use the NEST_TO_MAP transformation to create the new column.
C
Use AWS Glue DataBrew to read the files. Use the PIVOT transformation to create the new column.
D
Write a Lambda function in Python to read the files. Use the Python data dictionary type to create the new column.