Skip to content

Commit 48a0749

Browse files
adrian-wangmarmbrus
authored andcommitted
[Spark-3222] [SQL] Cross join support in HiveQL
We can simple treat cross join as inner join without join conditions. Author: Daoyuan Wang <[email protected]> Author: adrian-wang <[email protected]> Closes #2124 from adrian-wang/crossjoin and squashes the following commits: 8c9b7c5 [Daoyuan Wang] add a test 7d47bbb [adrian-wang] add cross join support for hql (cherry picked from commit 52fbdc2) Signed-off-by: Michael Armbrust <[email protected]>
1 parent 4d6a0e9 commit 48a0749

File tree

5 files changed

+2
-0
lines changed

5 files changed

+2
-0
lines changed

sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
310310
"create_nested_type",
311311
"create_skewed_table1",
312312
"create_struct_table",
313+
"cross_join",
313314
"ct_case_insensitive",
314315
"database_location",
315316
"database_properties",

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ private[hive] object HiveQl {
772772

773773
val joinType = joinToken match {
774774
case "TOK_JOIN" => Inner
775+
case "TOK_CROSSJOIN" => Inner
775776
case "TOK_RIGHTOUTERJOIN" => RightOuter
776777
case "TOK_LEFTOUTERJOIN" => LeftOuter
777778
case "TOK_FULLOUTERJOIN" => FullOuter

sql/hive/src/test/resources/golden/cross_join-0-7e4af1870bc73decae43b3383c7d2046

Whitespace-only changes.

sql/hive/src/test/resources/golden/cross_join-1-1a96761bf3e47ace9a422ed58273ff35

Whitespace-only changes.

sql/hive/src/test/resources/golden/cross_join-2-85c93a81eae05bf56a04a904bb80a229

Whitespace-only changes.

0 commit comments

Comments
 (0)