InterviewSolution
| 1. |
Name the operations supported by RDD and explain them. |
|
Answer» RDD supports 2 types of operations:
Transformations : Transformations are functions APPLIED on RDD, resulting in ANOTHER RDD. It does not execute until an action occurs. Some examples of transformations include a map, filter, and reduceByKey. These transformations apply to each element of RDD and result in another RDD. The filter() creates a new RDD by selecting elements to form current RDD that pass function argument. Actions: Actions are the result of RDD/Dataframe transformations or computations. Once an action is performed, the data from RDD moves back to the local machine. An action’s EXECUTION is the result of all previously created transformations. Some examples of actions include HEAD, collect, first, take and reduce. collect() is an action which converts RDD to Array of elements. take() action takes all the values from RDD to the local node. |
|