Skip to content

Commit ac74991

Browse files
committed
Merge remote-tracking branch 'origin/master' into doc-unified-tests
2 parents ad96a4d + 2553d53 commit ac74991

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ case class NaturalJoin(tpe: JoinType) extends JoinType {
102102
}
103103

104104
case class UsingJoin(tpe: JoinType, usingColumns: Seq[String]) extends JoinType {
105-
require(Seq(Inner, LeftOuter, LeftSemi, RightOuter, FullOuter, LeftAnti).contains(tpe),
105+
require(Seq(Inner, LeftOuter, LeftSemi, RightOuter, FullOuter, LeftAnti, Cross).contains(tpe),
106106
"Unsupported using join type " + tpe)
107107
override def sql: String = "USING " + tpe.sql
108108
}

sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ class DataFrameJoinSuite extends QueryTest
122122
df2.crossJoin(df1),
123123
Row(2, "2", 1, "1") :: Row(2, "2", 3, "3") ::
124124
Row(4, "4", 1, "1") :: Row(4, "4", 3, "3") :: Nil)
125+
126+
checkAnswer(
127+
df1.join(df2, Nil, "cross"),
128+
Row(1, "1", 2, "2") :: Row(1, "1", 4, "4") ::
129+
Row(3, "3", 2, "2") :: Row(3, "3", 4, "4") :: Nil)
130+
131+
checkAnswer(
132+
df2.join(df1, Nil, "cross"),
133+
Row(2, "2", 1, "1") :: Row(2, "2", 3, "3") ::
134+
Row(4, "4", 1, "1") :: Row(4, "4", 3, "3") :: Nil)
125135
}
126136

127137
test("broadcast join hint using broadcast function") {

0 commit comments

Comments
 (0)