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

Certified Associate Developer for Apache Spark Exam - Question 111


The code block shown below contains an error. The code block is intended to return a new DataFrame that is the result of a position-wise union between DataFrame storesDF and DataFrame acquiredStoresDF.

Show Answer
Correct Answer: E

To perform a position-wise union in PySpark between two DataFrames, the 'union' method should be used. Therefore, the correct code would be 'storesDF.union(acquiredStoresDF)'. This method appends the rows of acquiredStoresDF to storesDF, resulting in a new DataFrame that contains the rows of both original DataFrames.

Discussion

2 comments
Sign in to comment
newusername
Nov 9, 2023

could you please fix the question? It is missing part of it. Though the answer is correct

SaiPavan10Option: E
Apr 4, 2024

E is the right choice.