
Ultimate access to all questions.
A data engineer has developed a data pipeline to ingest data from a JSON source using Auto loader, but the engineer has not provided any type inference or schema hints in their pipeline. Upon reviewing the data, the data engineer has noticed that all of the columns in the target table are of the string type despite some of the fields only including float or boolean values.
Which of the following describes why Auto Loader inferred all of the columns to be of the string type?
A
There was a type mismatch between the specific schema and the inferred schema
B
JSON data is a text-based format
C
Auto Loader only works with string data
D
All of the fields had at least one null value
E
Auto Loader cannot infer the schema of ingested data
Explanation:
Correct Answer: B. JSON data is a text-based format
JSON (JavaScript Object Notation) is fundamentally a text-based data interchange format. When Auto Loader ingests JSON data without explicit schema hints or type inference, it treats all values as strings by default because:
123.45 or boolean values like true/false are represented as text strings in JSON files..schema()cloudFiles.schemaEvolutionMode settingWhy other options are incorrect:
Best Practice Recommendation: To avoid this issue, data engineers should either:
cloudFiles.inferColumnTypes = true