I have K/V pairs where V is an Iterable (from previous groupBy). I use the JAVA API. What I want is to iterate over the values by key, and on every element set previousElementId attribute, that is the id of the previous element in the sorted list. I try to do this with mapValues. I create an array from the Iterable, sort the list there and iterate over the values, setting the attribute and saving the reference for the next element. After that, return the array. Is this the best approach or I miss something?
Spark version: 1.4.1 Java version: 1.8 Thanks in advance. Mate -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Iterating-over-values-by-Key-tp24029.html Sent from the Apache Spark User List mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org