QuestionQ225
VerifiedUsing Spark SQLA data engineer is using Spark SQL with a large JSON file located at /data/input.json. The file has records with varying schemas, and the engineer wants to create an external Spark SQL table that queries the file directly, without first loading it into a DataFrame.
The engineer must:
- Create an external table named
usersthat reads from/data/input.json. - Ensure Spark automatically infers the schema.
- Merge the differing record schemas.
Which code snippet should the data engineer use to complete this task?
Community Discussion