DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-0 practice question 1 of 25

The code block displayed below contains an error. The code block is intended to perform an outer join of DataFrames transactionsDf and itemsDf on columns productId and itemId, respectively. Find the error. Code block: transactionsDf.join(itemsDf, [itemsDf.itemId, transactionsDf.productId], "outer")

Full set: 180 questions
Answer options
A:

A. The "outer" argument should be eliminated, since "outer" is the default join type.

B:

B. The join type needs to be appended to the join() operator, like join().outer() instead of listing it as the last argument inside the join() call.

C:

C. The term [itemsDf.itemId, transactionsDf.productId] should be replaced by itemsDf.itemId == transactionsDf.productId.

D:

D. The term [itemsDf.itemId, transactionsDf.productId] should be replaced by itemsDf.col("itemId") == transactionsDf.col("productId").

E:

E. The "outer" argument should be eliminated from the call and join should be replaced by joinOuter.

Correct Answer:
<P>C</P>
Explanation

Correct code block: transactionsDf.join(itemsDf, itemsDf.itemId == transactionsDf.productId, "outer") Static notebook | Dynamic notebook: See test 1, ( Databricks import instructions) (<a href="https://flrs.github.io/spark_practice_tests_code/#1/33.html" rel="noopener noreferrer" target="_blank" style="color: rgb(29, 78, 216);">https://flrs.github.io/spark_practice_tests_code/#1/33.html , <a href="https://bit.ly/sparkpracticeexams_import_instructions)" rel="noopener noreferrer" target="_blank" style="color: rgb(29, 78, 216);">https://bit.ly/sparkpracticeexams_import_instructions)

Scroll to Top