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


##########
spark/src/test/scala/org/apache/comet/exec/CometJoinSuite.scala:
##########
@@ -336,4 +337,115 @@ 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 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 = 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)
+
+          // TODO: Enable these tests after fixing the issue:
+          // https://github.com/apache/datafusion-comet/issues/861
+          /*
+          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 = 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)
+           */
+        }
+      }
+    }
+  }
+
+  test("full outer join") {

Review Comment:
   The fix was merged at DataFusion. I updated Comet to use the latest commit.



-- 
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