Created
June 24, 2016 14:42
-
-
Save danared/c8a7fb0f639803015bda4517df824093 to your computer and use it in GitHub Desktop.
This file contains 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
def main(args: Array[String]): Unit = { | |
// Set up configurations | |
val sc = getSparkContext() | |
val sqlContext = SQLContext.getOrCreate(sc) | |
val readConfig = ReadConfig(Map("uri" -> "mongodb://127.0.0.1/movies.movie_ratings?readPreference=primaryPreferred")) | |
val writeConfig = WriteConfig(Map("uri" -> "mongodb://127.0.0.1/movies.user_recommendations")) | |
val userId = 0 | |
// Load the movie rating data | |
val movieRatings = MongoSpark.load(sc, readConfig).toDF[UserMovieRating] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment