Certified Associate Developer for Apache Spark Exam QuestionsBrowse all questions from this exam

Certified Associate Developer for Apache Spark Exam - Question 71


Which of the following code blocks returns a new DataFrame where column division from DataFrame storesDF has been replaced and renamed to column state and column managerName from DataFrame storesDF has been replaced and renamed to column managerFullName?

Show Answer
Correct Answer: A

The method withColumnRenamed is used to rename columns in a DataFrame. To achieve the desired changes, applying withColumnRenamed twice, first to rename 'division' to 'state' and then 'managerName' to 'managerFullName', is correct. Option A accurately reflects this, making it the correct choice.

Discussion

2 comments
Sign in to comment
zozoshankyOption: B
Jul 30, 2023

B is the answer.

newusername
Nov 7, 2023

you are wrong! The answer is A

azure_bimonsterOption: A
Feb 9, 2024

A would be the right one here.