Jan 13, 2020 in Big Data | Hadoop
Q: What are the common Actions in Apache Spark?

1 Answer

0 votes
Jan 13, 2020

Some of the commonly used Actions in Apache Spark are as follows:

1. Reduce(func): This Action aggregates the elements of a dataset by using func function.

2. Count(): This action gives the total number of elements in a Dataset.


3. Collect(): This action will return all the elements of a dataset as an Array to the driver program.

4. First(): This action gives the first element of a collection.

5. Take(n): This action gives the first n elements of dataset.

6. Foreach(func): This action runs each element in dataset through a for loop and executes function func on each element.

Related questions

0 votes
Mar 14, 2020 in Spark Sql
+1 vote
Jun 30, 2019 in Spark Sql