i am trying to create a dataframe based on 4 lists i have. i have to use scala only (we can't use SQL for various reasons).
all lists have 3 values, and the column_head list is a list of the column names.
column_head =["a","b","c"]
master_in =[1,2,"dog"]
master_out =[3,4,"cat"]
master_max = [5,6,"llama"]
ive tried:
val values
=Seq(columns_head,master_in,master_out,master_maxweight)
val master_df= values.toDF()
but i get an exception saying: java.lang.ClassNotFoundException: scala.Any
This is likely because the last value of each list is a STRING value, whereas the first two for each list are INTEGERS.
How do I solve this problem?
I can't import any other libraries outside of:
import org.apache.spark.sql.functions.desc
import org.apache.spark.sql.functions._
case class edges(Source: String, Target: String, Weight: Int)
import spark.implicits._
how do i make a df from the lists i have?