A data engineer runs the Auto Loader stream shown in the exhibit. The stream does not set cloudFiles.schemaEvolutionMode. Its tracked schema and target table do not contain phone_number. A source system will soon start sending this new field.
Requirements:
phone_numbermust be added to the schema that Auto Loader tracks in its schema location.- No one may write or edit column definitions by hand.
- Ingestion must continue to use this incremental Auto Loader stream; restarting the stream is acceptable.
(spark.readStream .format("cloudFiles") .option("cloudFiles.format", "json") .option("cloudFiles.schemaLocation", "/Volumes/sales/bronze/landing/_schema") .load("/Volumes/sales/bronze/landing/customers/") .writeStream .option("mergeSchema", "true") .option("checkpointLocation", "/Volumes/sales/bronze/landing/_checkpoint") .toTable("sales.bronze.customers"))
Which approach should the engineer use to handle the upcoming field?
Choose one answer.
- Configure
cloudFiles.schemaEvolutionModeasfailOnNewColumnsbefore the new field arrives. - Configure
cloudFiles.schemaEvolutionModeasrescuebefore the new field arrives. - Keep the current configuration and restart the stream after it stops on the new field.
- Replace the stream with a batch append that sets
mergeSchematotrue.