I have a dataframe df
| col |
|---|
| {"A":"ppp","B":"ee","C":"sad"........} |
| . |
| . |
| . |
I am trying to use
schema = StructType([StructField("a", StringType()),StructField("b", StringType())])
df = df.withColumn('col',from_json('col',schema')).select(col('col'.*)
However, I get the below error due to data type mismatch: argument 1 requires string type however col is of map<string, string> type