QuestionQ97

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks fails to return the number of rows in DataFrame storesDF for every distinct combination of values in the division and storeCategory columns?

Choose three
Explanation

DataFrame.groupBy accepts multiple column names or Column expressions, including a list, and returns a GroupedData object on which count() produces a row count for each group. A and E are syntactically malformed. B is invalid because the first groupBy returns GroupedData, which is aggregated with methods such as count() rather than grouped again with groupBy.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!