in Spark Sql by
Q:
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)

Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

0 votes
asked Mar 9, 2020 in Spark Sql by SakshiSharma
+1 vote
asked Mar 9, 2020 in Spark Sql by SakshiSharma
+2 votes
asked May 8, 2020 in Ansible by SakshiSharma
0 votes
asked Mar 14, 2020 in Spark Sql by rajeshsharma
+1 vote
asked Jun 30, 2019 in Spark Sql by anonymous
...