K_Anudeep
Databricks Employee
Databricks Employee

Hey @Dhruv-22 ,

Oh .. this totally makes sense now. In that case, it is a true corrupt record..You can just add the read option DROPMALFORMED and it should work

df1 = (spark.read
.format("json")
.option("mode", "DROPMALFORMED") # <- drops malformed record
.load(base))

df1.display()
 
 
 
Anudeep