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?
- A.relationalize on the DynamicFrame
- B.drop_fields with price in the list
- C.resolveChoice with a cast:double specification for the price field
- 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
- Kinesis on-demand capacity mode
- MSK Connect sink connector to S3
- Graph data structures in Amazon Neptune
- S3 Intelligent-Tiering for unknown access
- Redshift concurrency scaling for bursts
- DynamoDB export to S3 for analytics
- Athena workgroup per-query scan limit
- Metric filter alarms on log patterns
- Glue sensitive data detection and redaction
- Parameter Store for non-secret configuration
- Lake Formation cross-account sharing