I am trying to use Spark SQL in the spring boot application. We would want to create the dataset from the list of objects (Employee). The Employee is a Scala case class that is defined by another team and we were able to define the list of objects in our project
But when we were trying to create a dataset from that list, we are getting an empty dataset without any values.
List<Employee> employees = new ArrayList<>();
employees.add(new Employee(1,"Tom",25));
Dataset<Row> employeeDF = spark.createDataFrame(employees,Employee.class);
The employeeDF is coming out to be empty, so not sure if we are doing it correctly or missing anything.
Is it possible to create a Dataset from the list of objects that refer to the Scala case class?
I tried everywhere to look for the issue and I was not able to find it. If its a duplicate please let me know.
Thanks for your reply Harminder