cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Autoloader is not able to infer schema from json

p_romm
New Contributor II

Hi, 
I have json files and it contains json array and only one object (payload below), I have set in autoloader inferSchema to true, however autoloader throws:
"Failed to infer schema for format json from existing files ..."
I have also check option to set multiLine to true, this doesn't work as well. 
If there is more items in array then autoloader works as expected, is there any setting that allows to infer schema based only on one item in array?

Payload:
[
    {
          "Time": "2025-02-17T19:53:38",
          "Published": "2025-02-14T12:00:33",
           "Id": "411042",
           "Name ": "Test",
           "Code": "24411"
    }
]

1 REPLY 1

p_romm
New Contributor II

Yep, my mistake, json file was corrupted. 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group