QuestionQ184

VerifiedUsing Spark SQL

Which of the following code blocks does not return a DataFrame reverse-sorted alphabetically by the division column?

Explanation

col("division").asc() explicitly specifies ascending order. Reverse alphabetical order requires descending order, such as ascending=False or desc("division"). PySpark documents that ascending accepts a Boolean or list of Booleans, and that desc returns a descending sort expression.

Learn more

Community Discussion

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