Certified Associate Developer for Apache Spark Exam QuestionsBrowse all questions from this exam

Certified Associate Developer for Apache Spark Exam - Question 9


Which of the following DataFrame operations is classified as an action?

Show Answer
Correct Answer: C

Among the given options, DataFrame.take() is classified as an action. Actions in Apache Spark’s DataFrame API trigger the execution of the transformations that have been applied and return a result or produce side effects. DataFrame.take() returns an array with the first n elements of the DataFrame, thereby initiating the computation. In contrast, other options like DataFrame.drop(), DataFrame.coalesce(), DataFrame.join(), and DataFrame.filter() are transformations, which define a new DataFrame from a previous one and are lazily evaluated.

Discussion

2 comments
Sign in to comment
TmDataOption: C
Jun 17, 2023

The DataFrame operation classified as an action is: C. DataFrame.take() Explanation: In Spark, actions are operations that trigger the execution of transformations on a DataFrame and return results or side effects. Actions are evaluated eagerly, meaning they initiate the execution of the computation plan built by transformations. Among the options provided, DataFrame.take() is an action because it returns an array with the first n elements from the DataFrame as an array. It triggers the execution of any pending transformations and collects the resulting data.

SonicBoom10C9Option: C
May 15, 2023

DataFrame.take(num: int) → List[pyspark.sql.types.Row] All the other functions return a dataframe again, which is defined as a transformation. An action returns a result of a computation, which take() does.

Nidhi_09
Aug 5, 2023

Hi, I am planning to take the exam, It would be very helpful if you could email me the dump. Thank you . email : <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="56253923383237242f373b37223e666f666516313b373f3a7835393b">[email protected]</a>