标签:文件 inline 上下 文件中 end hash ret store ops
val conf = new SparkConf()
conf.setMaster("local").setAppName("pvuv")
val sc = new SparkContext(conf)
val lineRDD = sc.textFile("./pvuv.txt")
?
lineRDD.map(x=>{
val sp=x.split("\\s")
(sp(5),1)
}).reduceByKey(_+_).foreach(println)
lineRDD.map(x=>{
val sp=x.split("\\s")
(sp(5),sp(0))
}).distinct().countByKey().foreach(println)
?
SparkConf sparkConf = new SparkConf()
.setMaster("local")
.setAppName("SecondarySortTest");
final JavaSparkContext sc = new JavaSparkContext(sparkConf);
?
JavaRDD<String> secondRDD = sc.textFile("secondSort.txt");
?
JavaPairRDD<SecondSortKey, String> pairSecondRDD = secondRDD.mapToPair(new PairFunction<String, SecondSortKey, String>() {
?
/**
*
*/
private static final long serialVersionUID = 1L;
?