We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ab4846 commit 8ff97edCopy full SHA for 8ff97ed
sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala
@@ -42,6 +42,19 @@ class DataFrameJoinSuite extends QueryTest with SharedSQLContext {
42
Row(1, 2, "1", "2") :: Row(2, 3, "2", "3") :: Row(3, 4, "3", "4") :: Nil)
43
}
44
45
+ test("join - join using multiple columns and specifying join type") {
46
+ val df = Seq(1, 2, 3).map(i => (i, i + 1, i.toString)).toDF("int", "int2", "str")
47
+ val df2 = Seq(1, 2, 3).map(i => (i, i + 1, (i + 1).toString)).toDF("int", "int2", "str")
48
+
49
+ checkAnswer(
50
+ df.join(df2, Seq("int", "str"), "left"),
51
+ Row(1, 2, "1", null) :: Row(2, 3, "2", null) :: Row(3, 4, "3", null) :: Nil)
52
53
54
+ df.join(df2, Seq("int", "str"), "right"),
55
+ Row(null, null, null, 2) :: Row(null, null, null, 3) :: Row(null, null, null, 4) :: Nil)
56
+ }
57
58
test("join - join using self join") {
59
val df = Seq(1, 2, 3).map(i => (i, i.toString)).toDF("int", "str")
60
0 commit comments