Actions
As discussed previously, Actions are what makes Spark perform the actual computation from the graph that the framework has been building in the background while you were busy performing transformations on it. While there is a long list of actions offered by Spark, we'll list the most common actions offered by Spark and take you through some of the most common ones:
|
|
|
|
|
|
|
|
|
|
|
Tip
The methods saveAsSequenceFile()
and saveAsObjectFil()
are only available in Java and Scala.
We have already seen reduce()
, collect()
, and count()
in the previous examples, so we'll be quickly going through their semantics, but will not provide examples for the sake of brevity.
Reduce(func)
As the name implies, reduce performs aggregation on the input dataset, which is often the result of a...