Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/16762#discussion_r104320606 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala --- @@ -584,24 +602,39 @@ class JoinSuite extends QueryTest with SharedSQLContext { val cartesianQueries = Seq( /** The following should error out since there is no explicit cross join */ "SELECT * FROM testData inner join testData2", - "SELECT * FROM testData left outer join testData2", - "SELECT * FROM testData right outer join testData2", - "SELECT * FROM testData full outer join testData2", + "SELECT * FROM testData, testData2", "SELECT * FROM testData, testData2 where testData.key = 1 and testData2.a = 22", + "SELECT * FROM testData, testData2 where testData.key > testData2.a", + "SELECT * FROM testData INNER JOIN testData2 ON testData.key + testData2.a = testData2.b", /** The following should fail because after reordering there are cartesian products */ "select * from (A join B on (A.key = B.key)) join D on (A.key=D.a) join C", "select * from ((A join B on (A.key = B.key)) join C) join D on (A.key = D.a)", /** Cartesian product involving C, which is not involved in a CROSS join */ - "select * from ((A join B on (A.key = B.key)) cross join D) join C on (A.key = D.a)"); + "select * from ((A join B on (A.key = B.key)) cross join D) join C on (A.key = D.a)") --- End diff -- The estimated size of `testData`, `testData2`, and `testData3` are much larger than the broadcast threshold. Thus, it does not consider the cases when the tables are small enough to broadcast. Thus, when the tables are small enough to broadcast, should we still block users? In that case, the join is not expensive. It affects the whole detection logics rewriting. Thanks! @rxin @hvanhovell @cloud-fan @sameeragarwal
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org