Skip to content

Commit e353340

Browse files
author
Paul Power
committed
Updated comments use correct sample code for Dataframe joins
The API signatire for join requires the JoinType to be the third parameter. The code examples provided for join show JoinType being provided as the 2nd parater resuling in errors (i.e. "df1.join(df2, "outer", $"df1Key" === $"df2Key") ). The correct example should be df1.join(df2, $"df1Key" === $"df2Key", "outer")
1 parent 3f00bb3 commit e353340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ class DataFrame protected[sql](
337337
* {{{
338338
* // Scala:
339339
* import org.apache.spark.sql.functions._
340-
* df1.join(df2, "outer", $"df1Key" === $"df2Key")
340+
* df1.join(df2, $"df1Key" === $"df2Key", "outer")
341341
*
342342
* // Java:
343343
* import static org.apache.spark.sql.functions.*;
344-
* df1.join(df2, "outer", col("df1Key") === col("df2Key"));
344+
* df1.join(df2, col("df1Key") === col("df2Key"), "outer");
345345
* }}}
346346
*
347347
* @param right Right side of the join.

0 commit comments

Comments
 (0)