Skip to content

Chapter 9: Recommendation Engines Using MapReduce

Programs of chapter 9 of the book Data Algorithms (O'Reilly, 2015), running on Spark 4.3.0.

Sample input: data/chap09/friends.txt

Run the commands from the repository folder after building the jar (Running the programs).

Spark (Java)

chap09.spark.SparkFriendRecommendation

Source: SparkFriendRecommendation.java

scripts/run_spark.sh org.dataalgorithms.chap09.spark.SparkFriendRecommendation data/chap09/friends.txt

Spark (Scala)

chap09.scala.FriendRecommendation

Source: FriendRecommendation.scala

scripts/run_spark.sh org.dataalgorithms.chap09.scala.FriendRecommendation data/chap09/friends.txt /tmp/data-algorithms/chap09.scala.FriendRecommendation/output