I have a JSON list which I am reading using from_json. How do I convert the resulting Column type to a single-column dataframe?
from pyspark.sql.functions import from_json
from pyspark.sql.types import ArrayType, StringType
jsonlist = '["a","b","c"]'
col = from_json(jsonlist , ArrayType(StringType()))
# how to I create a dataframe?
df = ...
Everything I have tried results in
TypeError: Column is not iterable
eg
spark.createDataFrame([col], ['item'])
I found that I can do this without using a pyspark function to parse the JSON: