How to create DataFrame from Scala's List of Iterables?

后端 未结 5 1217
孤独总比滥情好
孤独总比滥情好 2020-12-02 10:31

I have the following Scala value:

val values: List[Iterable[Any]] = Traces().evaluate(features).toList

and I want to convert it to a DataFr

5条回答
  •  眼角桃花
    2020-12-02 11:22

    Simplest approach:

    val newList = yourList.map(Tuple1(_))
    val df = spark.createDataFrame(newList).toDF("stuff")
    

提交回复
热议问题