I want to initialize a dataframe where some rows have None/Null value in spark scala(version 3.2.1). How to do this ?
val df = spark.createDataFrame(
Seq((0, "a", true), (1, "b", true), (2, "c", false), (3, "a", false), (4, "a", None), (5, "c", false))
).toDF("id", "category1", "category2")
df.show()
I get this error:
UnsupportedOperationException: Schema for type Any is not supported