Use case is to read a file and create a dataframe on top of it.After that get the schema of that file and store into a DB table.
For example purpose I am just creating a case class and getting the printschema however I am unable create a dataframe out of it
Here is a sample code
case class Employee(Name:String, Age:Int, Designation:String, Salary:Int, ZipCode:Int)
val spark = SparkSession
.builder()
.appName("Spark SQL basic example")
.config("spark.master", "local")
.getOrCreate()
import spark.implicits._
val EmployeesData = Seq( Employee("Anto", 21, "Software Engineer", 2000, 56798))
val Employee_DataFrame = EmployeesData.toDF
val dfschema = Employee_DataFrame.schema
Now dfschema is a structype and wanted to convert it in a dataframe of two columns , how to achieve that