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

Certified Associate Developer for Apache Spark 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__)

Show Answer
Correct Answer: CD

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

1 comment
Sign in to comment
Sowwy1Option: C
Apr 10, 2024

C. 1. storesDF 2. union 3.acquiredStoresDF