I have the following PySpark DataFrame. I need to extract JSON data stored as strings within a column in my DataFrame, and subsequently create multiple rows based on the extracted data in PySpark.
Example Input:
response (string column) |
---|
{"Customer Data": [{"id": "5", "name": "Jony"}, {"id": "10", "name": "Jems"}]} |
Expected output:
id (int) | name (string) |
---|---|
5 | Jony |
10 | Jems |
Any ideas how to do this?
2
Answers
Hope this fits your needs:
u can try this, it might help u: