小编nuw*_*uwa的帖子

Spark Dataframe - 获取所有对列表(Scala)

I have the following situation: I have a dataframe with an 'array' as the schema. Now I want to get for each array, all lists of pairs and save it again in a dataframe. So for example:

This is the original dataframe:

+---------------+
|  candidateList|
+---------------+
|         [1, 2]|
|      [2, 3, 4]|
|      [1, 3, 5]|
|[1, 2, 3, 4, 5]|
|[1, 2, 3, 4, 5]|
+---------------+
Run Code Online (Sandbox Code Playgroud)

And that is how it have to look like after the computation: …

scala apache-spark apache-spark-sql

4
推荐指数
1
解决办法
407
查看次数

标签 统计

apache-spark ×1

apache-spark-sql ×1

scala ×1