Casting a column to JSON/dict and flattening JSON values in a column in pyspark
问题 I am new to Pyspark and I am figuring out how to cast a column type to dict type and then flatten that column to multiple columns using explode . Here's how my dataframe looks like: col1 | col2 | ----------------------- test:1 | {"test1":[{"Id":"17","cName":"c1"},{"Id":"01","cName":"c2","pScore":0.003609}], {"test8":[{"Id":"1","cName":"c11","pScore":0.0},{"Id":"012","cName":"c2","pScore":0.003609}] test:2 | {"test1:subtest2":[{"Id":"18","cName":"c13","pScore":0.00203}]} Right now, the schema