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.
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.
upvoted 3 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
TmData
Highly Voted 1 year, 5 months agoBecida
Most Recent 1 month, 3 weeks agoSonicBoom10C9
1 year, 6 months ago