We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83216e1 commit 8fe6ca9Copy full SHA for 8fe6ca9
1 file changed
rdd/WordCount_p.py
@@ -0,0 +1,13 @@
1
+from pyspark import SparkConf,SparkContext
2
+
3
4
+if __name__ == "__main__":
5
+ print("hipy")
6
+ conf= SparkConf().setAppName("word count").setMaster("local[*]")
7
+ sc= SparkContext(conf= conf)
8
+ lines = sc.textFile("in/word_count.text")
9
10
+ words = lines.flatMap(lambda line: line.split(" "))
11
+ wordCounts = words.countByValue()
12
+ for word,count in wordCounts.items():
13
+ print("{}:{}".format(word,count))
0 commit comments