+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)

Related questions

0 votes
asked Feb 12, 2023 in Spark Sql by sharadyadav1986
0 votes
asked Aug 18, 2023 in Spark Sql by GeorgeBell
...