Help Center/
MapReduce Service/
Component Operation Guide (LTS) (Ankara Region)/
Using Spark/
Spark FAQ/
How Do I Handle the Exception Occurred When I Query Datasource Avro Formats?
Updated on 2024-11-29 GMT+08:00
How Do I Handle the Exception Occurred When I Query Datasource Avro Formats?
Symptom
An error is reported when I query Datasource Avro formats, and the message "Caused by: org.apache.spark.sql.avro.IncompatibleSchemaException" is displayed.
Solution
The datasource Avro formats are not compatible with the current data formats.
- For new Avro files, set spark.sql.forceConvertSchema.enabled to true before you create them. This forcibly converts Avro formats to the specified data types and changes the schema at a time.
- For existing Avro files, set spark.sql.forceConvertSchema.enabled to true before the query. If the query fails, run the refresh table command to clear the cache and then set query parameters. The Avro formats are forcibly converted to the specified data types, and the schema is temporarily modified on the client.
Parent topic: Spark FAQ
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot