DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #33
Which of the following operations can perform an outer join on two DataFrames?
The correct answer is D. DataFrame.join(). DataFrame.join() is the correct answer because it accepts a how parameter that supports outer join variants: "outer", "full", "full_outer", "left", "left_outer", "right", and "right_outer". DataFrame.crossJoin() (A) performs a Cartesian product, not an outer join. There is no…
Question
Which of the following operations can perform an outer join on two DataFrames?
Options
- ADataFrame.crossJoin()
- BStandalone join() function
- CDataFrame.outerJoin()
- DDataFrame.join()
- EDataFrame.merge()
How the community answered
(58 responses)- B2% (1)
- C3% (2)
- D93% (54)
- E2% (1)
Explanation
DataFrame.join() is the correct answer because it accepts a how parameter that supports outer join variants: "outer", "full", "full_outer", "left", "left_outer", "right", and "right_outer". DataFrame.crossJoin() (A) performs a Cartesian product, not an outer join. There is no standalone join() function (B) or DataFrame.outerJoin() method (C) in PySpark. DataFrame.merge() (E) is a pandas method and does not exist on PySpark DataFrames.
Topics
Community Discussion
No community discussion yet for this question.