Changes

Jump to: navigation, search

GPU621/Apache Spark Fall 2022

1 byte added, 15:57, 5 December 2022
Useful Case
//map to only words
JavaRDD<String> wordsRDD = removeBlankLineRDD.flatMap(sentence -> Arrays.asList(sentence.split(" ")).iterator());
 
//create pair RDD
JavaPairRDD<String, Long> pairRDD = wordsRDD.mapToPair(word -> new Tuple2<>(word, 1L));
92
edits

Navigation menu