I have a case class like that:
case class ResultDays (name: String, number: Double, values: Double*)
and I want to save it into a .csv file
resultRDD.toDF()
.coalesce(1)
.write.format("com.databricks.spark.csv")
.option("header", "true")
.save("res/output/result.csv")
Unfortunately I have this error:
java.lang.UnsupportedOperationException: CSV data source does not support array<double> data type.
So, how can I insert a variable number of values and save it into a .csv?
valuesmember might have?valuesfor every row, but I don't know how manyvaluesI have before run.resultRDD, you can assume all records have the same number of values?ResultDaysclass it containsDouble*and it seems I cannot use that