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: 

"Databricks" - "PySpark" - Read "JSON" file - Azure Blob container - "APPEND BLOB"

hare
New Contributor III

Hi All,

 We are getting JSON files in Azure blob container and its "Blob Type" is "Append Blob".

We are getting an error "

AnalysisException: Unable to infer schema for JSON. It must be specified manually.", when we try to read using below mentioned script.

df = spark.read.json(source_location,multiLine=True,pathGlobFilter='2022-05-18T02_50_01_914Z_student.json')

df.createOrReplaceTempView('v_df')

spark.sql("select count(*) from v_df").display()

can anyone please do let me know if we have any option to read JSON files which has the blob type "Append Blob"? - We are using "Databricks" - "PySpark"

3 REPLIES 3

Kaniz_Fatma
Community Manager
Community Manager

Hi @Hareesh Makam​ , Please check the path and try again.

Kaniz_Fatma
Community Manager
Community Manager

Hi @Hareesh Makam​ , We haven’t heard from you on the last response from me, and I was checking back to see if you have a resolution yet. If you have any solution, please share it with the community as it can be helpful to others. Otherwise, we will respond with more details and try to help.

User16856839485
New Contributor II
New Contributor II

There currently does not appear to be direct support for append blob reads, however, converting the append blob to block blob [and then parquet or delta, etc.] are a viable option:

https://kb.databricks.com/en_US/data-sources/wasb-check-blob-types?_ga=2.258782666.1514035379.166567...

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