CertKeen

AWS Data Engineer Associate (DEA-C01) · Free practice question 3 of 12

Glue resolveChoice for ambiguous types

In an AWS Glue job at Penhale Foods, a DynamicFrame shows the price field as a choice type because some JSON records contain numbers and others contain strings such as "12.50". The target table needs price as a double. Which method should the data engineer call?

  1. A.relationalize on the DynamicFrame
  2. B.drop_fields with price in the list
  3. C.resolveChoice with a cast:double specification for the price field
  4. D.unbox on the price field with format json to parse the embedded value
Show answer and explanation

Correct answer: C. resolveChoice with a cast:double specification for the price field

Why: When Glue finds several types for one field it records a choice type; resolveChoice settles it, and the cast action converts all values to one type such as double. relationalize flattens nested structures into separate tables. Dropping the field loses the data. unbox parses a string field that contains an embedded structure such as JSON, which does not apply to plain numeric strings.

More free AWS Data Engineer Associate (DEA-C01) questions