Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this 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?

    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
azure_bimonsterOption: A

A would be the right one here.

zozoshankyOption: B

B is the answer.

newusername

you are wrong! The answer is A