
Answer-first summary for fast verification
Answer: DataFrame.groupBy()
A GroupedData object is returned after grouping operations in Spark, which allows subsequent aggregations. The correct methods that return GroupedData are groupBy(), cube(), rollup(), etc. Among the options provided, only option D (DataFrame.groupBy()) is the correct method that returns a GroupedData object. The other options either do not exist in Spark's DataFrame API or are not methods that return a GroupedData object.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.