I need to add an empty column of StructType to an existing DataFrame.
Tried following:
df = df.withColumn("features", typedLit(StructType(Nil)))
And:
df = df.withColumn("features", lit(new GenericRowWithSchema(Array(), StructType(Nil))))
However, in both of the above cases getting an error as unsupported literal type.