1

I using python in databricks to produce a json file :

%python
data= spark.sql("select * from table")
data.repartition(1).write.mode("overwrite").json("data/")

what I'm getting is :

{'id':1} {'id':2} {'id':}

but What I'm looking for is :

{'id':1}, {'id':2}, {'id':}

how can I add the comma with python using databricks please ?

Java user
  • 261
  • 3
  • 18

0 Answers0