Hello,
I have a key value pair, whose value is an ArrayList and I would like to
move one value of the ArrayList to the key position and the key back into
the ArrayList. Is it possible to do tis with java lambda expression?

This workes in python:
newMap = sourceMap.map(lambda (key,((value1, value2), value3)) : (value1,
(key, value2,value3)))

I resolved this in Java with the abstract "call" method, but is there a way
to do this with lambda expression, to reduce the number of lines needed?

JavaPairRDD<String, ArrayList&lt;String>> newMap=
sourceMap.flatMapToPair((String a, ArrayList<String> b) -> ??? 

Thank you for any suggestions
Rob



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/restructure-key-value-pair-with-lambda-in-java-tp19748.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