QuestionQ65

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks fails to return a new DataFrame resulting from an inner join of DataFrame storesDF and DataFrame employeesDF on the storeId and employeeId columns?

Explanation

PySpark DataFrame.join requires its on argument to be a column name or list of names shared by both DataFrames, or a boolean join expression (or list of boolean expressions). Bare col("storeId") and col("employeeId") expressions do not compare columns and therefore do not form valid join predicates. The default join type is inner.

Learn more

Community Discussion

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