QuestionQ88

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which pair of arguments cannot be used with DataFrame.join() to carry out an inner join on two DataFrames, named and aliased as "a" and "b" respectively, while specifying the two key columns column1 and column2?

Explanation

The Scala DataFrame.join overload for usingColumns requires a Seq[String] containing the names of columns that exist on both DataFrames. Seq(col("column1"), col("column2")) is a Seq[Column], not a Seq[String], and therefore does not match that overload. A compound equality condition is instead supplied through the joinExprs: Column overload.

Learn more

Community Discussion

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