DEA-C01 practice question: Transformation with AWS Glue (3 of 3)
Data Ingestion and Transformation A free question from our original DEA-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
A healthcare-scheduling vendor's AWS Glue job reads CSV exports from its customers. In some files, the phone_extension column holds numbers, and in others it holds text such as "ext. 12". The DynamicFrame shows the column as a choice type, and the write to the Parquet target fails.
The data team must keep every value, the job must finish without manual steps, and the downstream tables should use one type for the column.
Which change meets these requirements?
Choose one answer.
AA. Call resolveChoice on the DynamicFrame to cast phone_extension to string before the write, so that every value is kept.
BB. Set the job to retry up to ten times, so that the mismatch clears itself on a later attempt when the file is read again.
CC. Delete the mixed files before the job runs, and add a note to the customers to send only numeric phone extensions.
DD. Run a Glue crawler before each job so that the column's type is set to integer, and let the job discard any value that is not a number.
Show the answer and explanation
Answer: A
A. Right: Correct. A DynamicFrame records a column with more than one type as a choice type, and resolveChoice with a cast action turns it into a single type. Casting to string keeps both the numbers and the text, so no value is lost. Learn more: ResolveChoice class (opens in a new tab)
B. Wrong: Retries repeat the same read of the same file, so the type mismatch comes back each time. The option does not change how the job handles the column.
C. Wrong: Deleting files drops real data, and it relies on customers changing their exports. The team must keep every value, so this option breaks a stated requirement.
D. Wrong: A crawler sets the catalog type from the data it sees, and the job would then discard the text values. The option loses the data the team needs to keep.
Explanation
A DynamicFrame can carry mixed types in one column as a choice type, but a typed target such as Parquet needs one type. Resolving the choice with a cast to string before the write keeps every value and needs no manual step. Retries, deleting data and forcing an integer type each fail one of the requirements.
Want more on Transformation with AWS Glue? The 5 full-length practice sets have 10 more Transformation with AWS Glue questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →