facing format issue while converting one type nested json to other brand new json schema
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2021 09:50 PM
Hi,
We are writing our flatten json dataframe to user defined nested schema json using pysprk in Databricks.But we are not getting the expected format
Expecting :
{"ID":"aaa",c_id":[{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"1"},{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"2"},{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"3"}]
But Getting :
{"ID":"aaa",c_id":{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"1"}},
{"ID":"aaa",c_id":{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"2"}},
{"ID":"aaa",c_id":{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"3"}}
We tried with group_by and collect list but not getting in expected format.
Could someone please help us is there any way to achieve it.
Thank you in advance
- Labels:
-
Azure databricks
-
Format Issue
-
Pyspark