0

I want to convert the DataFrame to nested JSON.

Source Data:

DataFrame has data values like: [you.you1.you3: String, you.you1.me2:decimal ]

Expected Output:

I have to convert DataFrame value to Json like { "you" : { "you1" :{ "you3" : String,"me2":decimal}}}

Appreciate your help!

sajjad rezaei
  • 945
  • 1
  • 10
  • 23
sam
  • 11
  • 1
  • Welcome to stackoverflow! Please see [how-to-ask](https://stackoverflow.com/help/how-to-ask). And especially for Spark questions [How to make good reproducible Apache Spark examples](https://stackoverflow.com/questions/48427185/how-to-make-good-reproducible-apache-spark-examples) – blackbishop Feb 01 '22 at 11:37
  • Does this answer your question? [Spark Scala dataframe columns to nested json](https://stackoverflow.com/questions/63858239/spark-scala-dataframe-columns-to-nested-json) – Thekingis007 Feb 01 '22 at 11:52

0 Answers0