Open main menu

CDOT Wiki β

Changes

GPU621/Apache Spark Fall 2022

9 bytes added, 21:15, 3 December 2022
RDD APIs
// map from one RDD to another RDD
JavaRDD<Double> mapRDD = javaRDD.map(value -> Math.sqrt(value));
// Output: 3.3166247903554, 4.69041575982343, 5.744562646538029, 6.6332495807108
mapRDD.foreach(value->System.out.println(value));
//use filter
JavaRDD<Double> filterRDD = javaRDD.filter(value ->value>=30);
// Output: 33 44
filterRDD.foreach(value->System.out.println(value));
92
edits