Pyspark json array string to columns

Viewed 34

One of the columns have the following string value. I need to convert it into columns using pyspark

columnName

{"data": {"address": {"city": "Dallas", "state": "Texas", "street1": "1234 23rd St", "zipCode": "98765"}, "cardAlias": "My Card1", "storeName": "DFW Store", "cardNumber": "123456789", "storeNumber": "20"}}

How can I split the string into multiple columns? I am interested in columns:

city, state, street1, zipCode, cardAlias, storeName, cardNumber, storeNumber

with values

Dallas, Texas, 1234 23rd St, My Card1, DFW Store, 123456789, 20

0 Answers
Related