Databricks Certified Associate Developer for Apache Spark 3.0 Exam Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Question # 13 Topic 2 Discussion

Databricks Certified Associate Developer for Apache Spark 3.0 Exam Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Question # 13 Topic 2 Discussion

Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Exam Topic 2 Question 13 Discussion:
Question #: 13
Topic #: 2

Which of the following code blocks returns a DataFrame where columns predError and productId are removed from DataFrame transactionsDf?

Sample of DataFrame transactionsDf:

1.+-------------+---------+-----+-------+---------+----+

2.|transactionId|predError|value|storeId|productId|f |

3.+-------------+---------+-----+-------+---------+----+

4.|1 |3 |4 |25 |1 |null|

5.|2 |6 |7 |2 |2 |null|

6.|3 |3 |null |25 |3 |null|

7.+-------------+---------+-----+-------+---------+----+


A.

transactionsDf.withColumnRemoved("predError", "productId")


B.

transactionsDf.drop(["predError", "productId", "associateId"])


C.

transactionsDf.drop("predError", "productId", "associateId")


D.

transactionsDf.dropColumns("predError", "productId", "associateId")


E.

transactionsDf.drop(col("predError", "productId"))


Get Premium Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 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.