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

The code block shown below contains an error. The code block intended to return a new DataFrame that is the result of an inner join between DataFrame storesDF and DataFrame employeesDF on column storeId. Identify the error.

Code block:

StoresDF.join(employeesDF, "inner", "storeID")

    Correct Answer: E

    The join function syntax in DataFrame operations expects the column key as the second parameter and the type of join as the third parameter. In this case, the correct call should be storesDF.join(employeesDF, "storeID", "inner") instead of the given storesDF.join(employeesDF, "inner", "storeID"). Switching the second and third arguments will correct this error.

Discussion
JticOption: E

E storesDF.join(employeesDF, "storeID", "inner") The column key is the second parameter to join() and the type of join is in the third parameter to join() – the second and third arguments should be switched

newusernameOption: E

there are diff methods to join dataframes, one of the: joinedDF = StoresDF.join(employeesDF, "storeId", "inner")