Issue converting the datasets into JSON

Kavin
Databricks Partner

Im a newbie to Databricks, I need to convert the data sets into JSON. i tried bth FOR JSON AUTO AND FOR JSON PATH, However im getting an issue - [PARSE_SYNTAX_ERROR] Syntax error at or near 'json'line

My Query works fine without FOR JSON AUTO AND FOR JSON PATH.

My Query:

Select ChecklistName as a from ***

FOR JSON AUTO

Can someone help me here.

Debayan
Databricks Employee
Databricks Employee

Hi @Kavin Natarajan​ , Could you please go through https://www.tutorialkart.com/apache-spark/spark-write-dataset-to-json-file-example/ , looks like the steps are okay.