You can also perform actions on an RDD, when you want to actually get a result. Here are some examples of what you can do:
- collect(): You can call collect() on an RDD, which will give you back a plain old Python object that you can then iterate through and print out the results, or save them to a file, or whatever you want to do.
- count(): You can also call count(), which will force it to actually go count how many entries are in the RDD at this point.
- countByValue(): This function will give you a breakdown of how many times each unique value within that RDD occurs.
- take(): You can also sample from the RDD using take(), which will take a random number of entries from the RDD.
- top(): top() will give you the first few entries in that ...