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

Which of the following operations performs a cross join on two DataFrames?

    Correct Answer: D

    The correct option is DataFrame.crossJoin(). In PySpark or Apache Spark, the crossJoin() method of the DataFrame class is specifically designed to perform a cross join, which is a Cartesian product of two DataFrames. This means it pairs every row of the first DataFrame with every row of the second DataFrame. Other methods like DataFrame.join(), join(), and DataFrame.merge() do not perform a cross join but are used for different types of SQL joins (like inner join, left join, etc.). The correct option for performing a cross join is DataFrame.crossJoin().

Discussion
f728f7fOption: D

D - https://api-docs.databricks.com/python/pyspark/latest/pyspark.sql/api/pyspark.sql.DataFrame.crossJoin.html

Sowwy1Option: D

D. DataFrame.crossJoin()