QuestionQ132

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

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

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

PySpark DataFrame.join uses the parameter order join(other, on=None, how=None): the second argument specifies the join column or condition, and the third specifies the join type. An inner join on a shared key therefore places "storeID" second and "inner" third.

Learn more

Community Discussion

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