comphead commented on code in PR #553:
URL: https://github.com/apache/datafusion-comet/pull/553#discussion_r1725369561


##########
spark/src/test/scala/org/apache/comet/exec/CometJoinSuite.scala:
##########
@@ -336,4 +335,68 @@ class CometJoinSuite extends CometTestBase {
       }
     }
   }
+
+  test("SortMergeJoin with join filter") {
+    withSQLConf(
+      SQLConf.ADAPTIVE_AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1",
+      SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") {
+      withParquetTable((0 until 10).map(i => (i, i % 5)), "tbl_a") {
+        withParquetTable((0 until 10).map(i => (i % 10, i + 2)), "tbl_b") {
+          val df1 = sql(
+            "SELECT * FROM tbl_a JOIN tbl_b ON tbl_a._2 = tbl_b._1 AND " +
+              "tbl_a._1 > tbl_b._2")
+          checkSparkAnswerAndOperator(df1)
+
+          val df2 = sql(
+            "SELECT * FROM tbl_a LEFT JOIN tbl_b ON tbl_a._2 = tbl_b._1 " +
+              "AND tbl_a._1 > tbl_b._2")
+          checkSparkAnswerAndOperator(df2)
+
+          val df3 = sql(
+            "SELECT * FROM tbl_b LEFT JOIN tbl_a ON tbl_a._2 = tbl_b._1 " +
+              "AND tbl_a._1 > tbl_b._2")
+          checkSparkAnswerAndOperator(df3)
+
+          val df4 = sql(
+            "SELECT * FROM tbl_a RIGHT JOIN tbl_b ON tbl_a._2 = tbl_b._1 " +
+              "AND tbl_a._1 > tbl_b._2")
+          checkSparkAnswerAndOperator(df4)
+
+          val df5 = sql(
+            "SELECT * FROM tbl_b RIGHT JOIN tbl_a ON tbl_a._2 = tbl_b._1 " +
+              "AND tbl_a._1 > tbl_b._2")
+          checkSparkAnswerAndOperator(df5)
+
+          val df6 = sql(
+            "SELECT * FROM tbl_a FULL JOIN tbl_b ON tbl_a._2 = tbl_b._1 " +
+              "AND tbl_a._1 > tbl_b._2")
+          checkSparkAnswerAndOperator(df6)
+
+          val df7 = sql(
+            "SELECT * FROM tbl_b FULL JOIN tbl_a ON tbl_a._2 = tbl_b._1 " +
+              "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 =

Review Comment:
   I feel we can also use SQL for Anti, Semi joins?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to