Databricks Certified Associate Developer for Apache Spark — Question 63
The code block shown below should return a new DataFrame that is the result of an inner join between DataFrame storeDF and DataFrame employeesDF on column storeId. Choose the response chat correctly fills in the numbered blanks within the code block to complete this task.
Code block:
storesDF.__1__(__2__, __3__, __4__)
Answer options
- A. 1. join 2. employeesDF 3. "inner" 4. storesDF.storeId === employeesDF.storeId
- B. 1. join 2. employeesDF 3. "storeId" 4. "inner"
- C. 1. merge 2. employeesDF 3. "storeId" 4. "inner"
- D. 1. join 2. employeesDF 3. "inner" 4. "storeId"
- E. 1. join 2. employeesDF 3. "inner" 4. "storeId"
Correct answer: B
Explanation
The correct answer is B because it correctly specifies the 'join' method to combine the DataFrames, uses 'employeesDF' as the second DataFrame, and accurately identifies 'storeId' as the column on which to join the DataFrames. Other options either incorrectly specify the column names or use the wrong method for joining, which would not achieve the desired inner join result.