Skip to content

Commit

Permalink
Enable test
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed May 16, 2024
1 parent b13173d commit 152df93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ case class CometHashJoinExec(
this.copy(left = newLeft, right = newRight)

override def stringArgs: Iterator[Any] =
Iterator(leftKeys, rightKeys, joinType, condition, left, right)
Iterator(leftKeys, rightKeys, joinType, buildSide, condition, left, right)

override def equals(obj: Any): Boolean = {
obj match {
Expand Down
25 changes: 17 additions & 8 deletions spark/src/test/scala/org/apache/comet/exec/CometJoinSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,27 @@ class CometJoinSuite extends CometTestBase {
// Left join: build left
// sql("SELECT /*+ SHUFFLE_HASH(tbl_a) */ * FROM tbl_a LEFT JOIN tbl_b ON tbl_a._2 = tbl_b._1")

// TODO: DataFusion HashJoin doesn't support build right yet.
// Inner join: build right
// sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a JOIN tbl_b ON tbl_a._2 = tbl_b._1")
//
val df4 =
sql(
"SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a JOIN tbl_b ON tbl_a._2 = tbl_b._1")
checkSparkAnswerAndOperator(df4)

// Left join: build right
// sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a LEFT JOIN tbl_b ON tbl_a._2 = tbl_b._1")
//
val df5 =
sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a LEFT JOIN tbl_b ON tbl_a._2 = tbl_b._1")
checkSparkAnswerAndOperator(df5)

// Right join: build right
// sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a RIGHT JOIN tbl_b ON tbl_a._2 = tbl_b._1")
//
val df6 =
sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a RIGHT JOIN tbl_b ON tbl_a._2 = tbl_b._1")
checkSparkAnswerAndOperator(df6)

// Full join: build right
// sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a FULL JOIN tbl_b ON tbl_a._2 = tbl_b._1")
val df7 =
sql("SELECT /*+ SHUFFLE_HASH(tbl_b) */ * FROM tbl_a FULL JOIN tbl_b ON tbl_a._2 = tbl_b._1")
checkSparkAnswerAndOperator(df7)

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

0 comments on commit 152df93

Please sign in to comment.