QuestionQ217

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

The code block below must return a new DataFrame that results from an inner join of DataFrame storesDF and DataFrame employeesDF on columns storeId and employeeId. Choose the response that correctly fills the numbered blanks in the code block to complete this task.

Code block:

storesDF.join(employeesDF, [__1__ == __2__, __3__ == __4__])  
Explanation

DataFrame.join accepts a list of Column join expressions, and its default join type is inner. The required equi-join predicates are storesDF.storeId == employeesDF.storeId and storesDF.employeeId == employeesDF.employeeId; qualifying each column with its DataFrame ensures each comparison uses the intended left- and right-side columns.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!