Hi, please have a look to the PR https://github.com/apache/spark/pull/24367
The PR adds support to avro objects by modifying the Encoder javaBean (JavaTypeInference) There is 2 other PRs to add encoder for avro objects: https://github.com/apache/spark/pull/24299, and https://github.com/apache/spark/pull/22878 regards -- Taoufik Dachraoui