Last active
August 29, 2015 14:20
-
-
Save juliensimon/94062eebc44411970582 to your computer and use it in GitHub Desktop.
Spark5.java - no lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PairFunction<String, String, String> keyFunc = | |
| new PairFunction<String, String, String>() { | |
| public Tuple2<String, String> call(String x) { | |
| return new Tuple2<String, String>(x.split(" ")[0], x.split(" ")[1]); | |
| } | |
| }; | |
| JavaPairRDD<String, String> pairRDD = inputRDD.mapToPair(keyFunc); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment