+1 vote
in Spark Sql by
How to programmatically specifying schema for DataFrame in Spark?

1 Answer

0 votes
by

valschemaMap = List(“id”,”name”,”salary”).map(field =>StructField(field,StringType,true))

val schema    = StructType(schemaMap)

...