Re: Running spark from Eclipse and then Jar

2016-12-10 Thread Iman Mohtashemi
JavaSparkContext sc = new JavaSparkContext(conf); > > SparkSession spark = SparkSession > .builder() > .appName("Word Count") > .getOrCreate() > .newSession()

Re: Running spark from Eclipse and then Jar

2016-12-10 Thread Md. Rezaul Karim
t; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >&g

Re: Running spark from Eclipse and then Jar

2016-12-07 Thread Iman Mohtashemi
tion").setMaster("local[*]"); > JavaSparkContext sc = new JavaSparkContext(conf); > > SparkSession spark = SparkSession > .builder() > .appName("Word Count") > .getOrCreate() >

Re: Running spark from Eclipse and then Jar

2016-12-07 Thread Md. Rezaul Karim
;> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> public final class JavaWordCount { >> private static

Re: Running spark from Eclipse and then Jar

2016-12-07 Thread Iman Mohtashemi
.newSession(); > > > JavaRDD lines = spark.read().textFile(args[0]).javaRDD(); > > > JavaRDD words = lines.flatMap(new FlatMapFunction<String, > String>() { > @Override > public Iterator call(String s) { > return A

Re: Running spark from Eclipse and then Jar

2016-12-07 Thread Md. Rezaul Karim
ds = lines.flatMap(new FlatMapFunction<String, > String>() { > @Override > public Iterator call(String s) { > return Arrays.asList(SPACE.split(s)).iterator(); > } > }); > > JavaPairRDD<String, Integer> ones = words.mapToPair( >

Re: Running spark from Eclipse and then Jar

2016-12-07 Thread Gmail
JavaPairRDD<String, Integer> ones = words.mapToPair( > new PairFunction<String, String, Integer>() { >@Override >public Tuple2<String, Integer> call(String s) { > return new Tuple2<>(s, 1); >} &g

Running spark from Eclipse and then Jar

2016-12-07 Thread im281
nts.collect(); for (Tuple2 tuple : output) { System.out.println(tuple._1() + ": " + tuple._2()); } spark.stop(); } } -- View this message in context: http://apache-spark-user-list.1001560.n