Databricks Certified Associate Developer for Apache Spark — Question 57

Which of the following code blocks fails to return a DataFrame reverse sorted alphabetically based on column division?

Answer options

Correct answer: C

Explanation

The correct answer is C because it sorts the division column in ascending order instead of the required descending order. Options A, B, D, and E correctly implement descending sorting for the division column, either through the use of ascending = False or the desc function.