June 2017
Beginner to intermediate
296 pages
7h 4m
English
Finally, we're going to perform an action on our RDD. So far we've transformed the RDD into the form that we want. We took our raw input data and created an RDD that contains nothing but ratings as its values. Now we can perform an action with this line of code:
result = ratings.countByValue()
What we're doing is calling our ratings RDD, which includes just the rating values in our example, 3, 3, 1, 2, and 1. Then we call an action method on that RDD, countByValue. This is a very easy way to cheat and quickly create something like a histogram:

What it does is count up how many times each unique value in ...
Read now
Unlock full access