How to convert List to JavaRDD

前端 未结 2 1939
隐瞒了意图╮
隐瞒了意图╮ 2021-02-11 15:48

We know that in spark there is a method rdd.collect which converts RDD to a list.

List f= rdd.collect();
String[] array = f.toArray(new String[f.si         


        
2条回答
  •  清歌不尽
    2021-02-11 16:34

    You're looking for JavaSparkContext.parallelize(List) and similar. This is just like in the Scala API.

提交回复
热议问题