Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my_RDD = spark.textFile("hdfs://...")
- words = my_RDD.flatMap(lambda line : line.split(" "))
- .map(lambda word : (word, 1))
- .reduceByKey(lambda a, b : a + b)
- words.saveAsTextFile("hdfs://...")
Advertisement
Add Comment
Please, Sign In to add comment