>From my map function I create Tuple2<Integer, Integer> pairs. Now I want to
reduce them, and get something like Tuple2<Integer, List&lt;Integer>>. 

The only way I found to do this was by treating all variables as String, and
in the reduceByKey do
/return a._2 + "," + b._2/ //in which both are numeric values saved in a
String
After which I do a Arrays.asList(string.split(",")) in mapValues. This
leaves me with <String, List&lt;Integer>>. So now I am looking for either
- A function with which I can transform <String, List&lt;Integer>> to
<Integer, List&lt;Integer>>
or
- A way to reduce Tuple2<Integer, Integer> into a Tuple2<Integer,
List&lt;Integer>> in the reduceByKey function so that I can use Integers all
the way

Of course option two would have preferences.

Thanks!



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Reduce-Tuple2-Integer-Integer-to-Tuple2-Integer-List-Integer-tp14361.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

Reply via email to