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

The code block shown below should return a new DataFrame that is the result of a position-wise union between DataFrame storesDF and DataFrame acquiredStoresDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__(__3__)

    Correct Answer: D

    To return a new DataFrame that is the result of a position-wise union between DataFrame storesDF and DataFrame acquiredStoresDF, the correct method to use is unionByName. This method ensures that columns are matched by name. Therefore, the correct code is storesDF.unionByName(acquiredStoresDF).

Discussion
Sowwy1Option: C

C. 1. storesDF 2. union 3.acquiredStoresDF