Which of the following code blocks fails to return the number of rows in DataFrame storesDF for each distinct combination of values in column division and column storeCategory?
A.
storesDF.groupBy((col("division"), col("storeCategory")]).count()
B.
storesDF.groupBy("division").groupBy("storeCategory").count()
C.
storesDF.groupBy(["division", "storeCategory"]).count()
D.
storesDF.groupBy("division", "storeCategory").count()
E.
storesDF.groupBy(col("division“), col("storeCategory")).count()
it is possible to run in pyspark - storesDF.groupBy("division", "storeCategory").count()
Correct answer is B
upvoted 2 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.
SaiPavan10
7 months, 3 weeks agoYiJiaSu
9 months, 1 week agoAhlo
9 months ago