Databricks Certified Associate Developer for Apache Spark 3.5 – Python Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Question # 31 Topic 4 Discussion

Databricks Certified Associate Developer for Apache Spark 3.5 – Python Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Question # 31 Topic 4 Discussion

Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Exam Topic 4 Question 31 Discussion:
Question #: 31
Topic #: 4

A DataFrame df has columns name, age, and salary. The developer needs to sort the DataFrame by age in ascending order and salary in descending order.

Which code snippet meets the requirement of the developer?


A.

df.orderBy(col("age").asc(), col("salary").asc()).show()


B.

df.sort("age", "salary", ascending=[True, True]).show()


C.

df.sort("age", "salary", ascending=[False, True]).show()


D.

df.orderBy("age", "salary", ascending=[True, False]).show()


Get Premium Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.