Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this 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?

    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
237f4d0Option: A

A, because col keyword is not needed while joining

tangerine141Option: A

Sorry A, no col

tangerine141Option: B

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