Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/5208#discussion_r28394315
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala ---
@@ -91,6 +94,16 @@ class JoinSuite extends QueryTest with
BeforeAndAfterEach {
("SELECT * FROM testData full JOIN testData2 ON (key * a != key +
a)",
classOf[BroadcastNestedLoopJoin])
).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
+ try {
+ conf.setConf("spark.sql.planner.sortMergeJoin", "true")
+ Seq(
+ ("SELECT * FROM testData JOIN testData2 ON key = a",
classOf[SortMergeJoin]),
+ ("SELECT * FROM testData JOIN testData2 ON key = a and key = 2",
classOf[SortMergeJoin]),
+ ("SELECT * FROM testData JOIN testData2 ON key = a where key = 2",
classOf[SortMergeJoin])
+ ).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
+ } finally {
+ conf.setConf("spark.sql.planner.sortMergeJoin",
SORTMERGEJOIN_ENABLED.toString)
+ }
}
test("broadcasted hash join operator selection") {
--- End diff --
Let's also add a test in this one to make sure broadcast join will be
selected when sort merge join is on.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]