Skip to content

Commit

Permalink
Change to SQL syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Aug 21, 2024
1 parent 68d9b04 commit 95e29cb
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions spark/src/test/scala/org/apache/comet/exec/CometJoinSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -377,23 +377,24 @@ class CometJoinSuite extends CometTestBase {
"AND tbl_a._1 > tbl_b._2")
checkSparkAnswerAndOperator(df7)

val left = sql("SELECT * FROM tbl_a")
val right = sql("SELECT * FROM tbl_b")

val df8 =
left.join(right, left("_2") === right("_1") && left("_2") >= right("_1"), "leftsemi")
val df8 = sql(
"SELECT * FROM tbl_a LEFT SEMI JOIN tbl_b ON tbl_a._2 = tbl_b._1 " +
"AND tbl_a._2 >= tbl_b._1")
checkSparkAnswerAndOperator(df8)

val df9 =
right.join(left, left("_2") === right("_1") && left("_2") >= right("_1"), "leftsemi")
val df9 = sql(
"SELECT * FROM tbl_b LEFT SEMI JOIN tbl_a ON tbl_a._2 = tbl_b._1 " +
"AND tbl_a._2 >= tbl_b._1")
checkSparkAnswerAndOperator(df9)

val df10 =
left.join(right, left("_2") === right("_1") && left("_2") >= right("_1"), "leftanti")
val df10 = sql(
"SELECT * FROM tbl_a LEFT ANTI JOIN tbl_b ON tbl_a._2 = tbl_b._1 " +
"AND tbl_a._2 >= tbl_b._1")
checkSparkAnswerAndOperator(df10)

val df11 =
right.join(left, left("_2") === right("_1") && left("_2") >= right("_1"), "leftanti")
val df11 = sql(
"SELECT * FROM tbl_b LEFT ANTI JOIN tbl_a ON tbl_a._2 = tbl_b._1 " +
"AND tbl_a._2 >= tbl_b._1")
checkSparkAnswerAndOperator(df11)
}
}
Expand Down

0 comments on commit 95e29cb

Please sign in to comment.