I have a JavaRDD of a list of class objects. I want to flatten it to a JaveRDD of class objects such that JavaRDD<{1, 2, 3, 4}, {5, 6, 7}> goes to JavaRDD<1, 2, 3, 4, 5, 6, 7>
in this post Convert RDD List to RDD of individual element in spark one solution is
val newrdd = rdd.flatmap(line => line)
however, line=>line is scala (I think) I tried
rdd.flatmap(line-> line)
and it gives and error
"no instance(s) of type variable(s) U exist so that List conforms to Iterator "
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.