I'm trying to create a dataframe using what seems to be the canonical "hello world" of creating spark dataframes and cannot fathom why its failing. Help!
from pyspark.sql.types import *
schema = StructType([StructField("product", StringType(), True)])
l = [('foo')]
rdd = sc.parallelize(l)
df = sqlContext.createDataFrame(rdd, schema)
df.show()
Above code throws below error
ValueError: Unexpected tuple 'foo' with StructType`
The code is basically lifted straight out of pyspark.sql module so i am completely stumped.