Created
April 23, 2025 23:25
-
-
Save mmafrar/655e5c51e229956dfa9eb413e92a3377 to your computer and use it in GitHub Desktop.
Big Data Processing - Case Study 2 (Spark)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val input_file = sc. textFile("/Users/mmafrar/WordCount/input_file.txt") | |
input_file.collect | |
val word = input_file.flatMap(line => line.split(" ")) | |
word.collect | |
val mapdata = word. map (word => (word, 1)) | |
val reducedata = mapdata. reduceByKey (_+_) | |
reducedata.collect | |
reducedata.saveAsTextFile ("/Users/mmafrar/WordCount/output_folder") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment