Spark Take FunctionIn Spark, the take function behaves like an array. It receives an integer value (let say, n) as a parameter and returns an array of first n elements of the dataset. Example of Take functionIn this example, we return the first n elements of an existing dataset.
Here, we got the desired output. Next TopicSpark Word Count Example |