Data Preparation for ML and AI
An AWS Glue ETL job reads JSON records whose amount field contains both numbers and numeric strings. The job must retain all records and write amount as a numeric Parquet column. Which transformation BEST meets these requirements?
Show the answer
Correct answerB. Use a DynamicFrame resolveChoice transformation to cast amount to double.
AWhy not this: Partitioning separates output records but does not convert amount to a consistent numeric type.
BWhy this is right: Casting the choice field to double produces a consistent numeric type while retaining the records.
CWhy not this: Removing amount loses a required output field rather than resolving its mixed types.
DWhy not this: Crawler schema updates change metadata, not the types of values written by the transformation job.
DynamicFrame resolveChoice can resolve mixed types by casting numeric strings and numbers to double. A crawler schema policy changes catalog metadata; it does not convert values in the output records.