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

Certified Associate Developer for Apache Spark Exam - Question 91


Which of the following code blocks fails to return a new DataFrame that is the result of an inner join between DataFrame storesDF and DataFrame employeesDF on column storeId and column employeeId?

Show Answer
Correct Answer: A

The correct answer is the option that fails to return a new DataFrame due to syntactical issues or incorrect usage of methods. In option A, `col("storeId")` and `col("employeeId")` should not be used with Seq, as Seq expects a collection of strings representing column names. Instead, it should simply be `Seq("storeId", "employeeId")`. This misuse of the `col` function in option A leads to a failure in executing an inner join, making option A incorrect.

Discussion

3 comments
Sign in to comment
237f4d0Option: A
Mar 29, 2024

A, because col keyword is not needed while joining

tangerine141Option: B
Mar 2, 2024

storesDF.join(employeesDF, Seq("storeId", "employeeId"))

tangerine141Option: A
Mar 2, 2024

Sorry A, no col