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

Certified Associate Developer for Apache Spark Exam - Question 109


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, Seq("storeId")

Show Answer
Correct Answer: AC

The key column storeId needs to be a string like “storeId”. The error in the code block is that the column name should be a string literal to properly specify the join key.

Discussion

6 comments
Sign in to comment
newusernameOption: C
Nov 9, 2023

The answer (C) is just the most wrong that could have been here

SaiPavan10Option: A
Apr 4, 2024

since the default join is inner so key column should be "StoreId"

cookiemonster42Option: A
Aug 2, 2023

I think the question is corrupt. The most plausible answer is A, even though the column name is already presented as a string.

newusername
Nov 9, 2023

yup, 100% is smth wrong, cause storesDF.join(employeesDF, Seq("storeId")) will work

saryuOption: A
Feb 2, 2024

A is right

Sowwy1Option: A
Apr 2, 2024

A is correct

deadbeef38
Jun 22, 2024

I don't see any error in the code other than a typo