Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7904#discussion_r36252719
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala ---
    @@ -97,82 +97,75 @@ 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 {
    -      ctx.conf.setConf(SQLConf.SORTMERGE_JOIN, true)
    +    withSQLConf(SQLConf.SORTMERGE_JOIN.key -> "false") {
           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])
    +        ("SELECT * FROM testData JOIN testData2 ON key = a", 
classOf[ShuffledHashJoin]),
    +        ("SELECT * FROM testData JOIN testData2 ON key = a and key = 2",
    +          classOf[ShuffledHashJoin]),
    +        ("SELECT * FROM testData JOIN testData2 ON key = a where key = 2",
    +          classOf[ShuffledHashJoin]),
    +        ("SELECT * FROM testData LEFT JOIN testData2 ON key = a", 
classOf[ShuffledHashOuterJoin]),
    +        ("SELECT * FROM testData RIGHT JOIN testData2 ON key = a where key 
= 2",
    +          classOf[ShuffledHashOuterJoin]),
    +        ("SELECT * FROM testData right join testData2 ON key = a and key = 
2",
    +          classOf[ShuffledHashOuterJoin]),
    +        ("SELECT * FROM testData full outer join testData2 ON key = a",
    +          classOf[ShuffledHashOuterJoin])
           ).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
    -    } finally {
    -      ctx.conf.setConf(SQLConf.SORTMERGE_JOIN, SORTMERGEJOIN_ENABLED)
         }
       }
     
       test("SortMergeJoin shouldn't work on unsortable columns") {
    -    val SORTMERGEJOIN_ENABLED: Boolean = ctx.conf.sortMergeJoinEnabled
    -    try {
    -      ctx.conf.setConf(SQLConf.SORTMERGE_JOIN, true)
    +    withSQLConf(SQLConf.SORTMERGE_JOIN.key -> "true") {
           Seq(
             ("SELECT * FROM arrayData JOIN complexData ON data = a", 
classOf[ShuffledHashJoin])
           ).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
    -    } finally {
    -      ctx.conf.setConf(SQLConf.SORTMERGE_JOIN, SORTMERGEJOIN_ENABLED)
         }
       }
     
       test("broadcasted hash join operator selection") {
         ctx.cacheManager.clearCache()
         ctx.sql("CACHE TABLE testData")
    -
    -    val SORTMERGEJOIN_ENABLED: Boolean = ctx.conf.sortMergeJoinEnabled
    -    Seq(
    -      ("SELECT * FROM testData join testData2 ON key = a", 
classOf[BroadcastHashJoin]),
    -      ("SELECT * FROM testData join testData2 ON key = a and key = 2", 
classOf[BroadcastHashJoin]),
    -      ("SELECT * FROM testData join testData2 ON key = a where key = 2",
    -        classOf[BroadcastHashJoin])
    -    ).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
    -    try {
    -      ctx.conf.setConf(SQLConf.SORTMERGE_JOIN, true)
    -      Seq(
    -        ("SELECT * FROM testData join testData2 ON key = a", 
classOf[BroadcastHashJoin]),
    -        ("SELECT * FROM testData join testData2 ON key = a and key = 2",
    -          classOf[BroadcastHashJoin]),
    -        ("SELECT * FROM testData join testData2 ON key = a where key = 2",
    -          classOf[BroadcastHashJoin])
    -      ).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
    -    } finally {
    -      ctx.conf.setConf(SQLConf.SORTMERGE_JOIN, SORTMERGEJOIN_ENABLED)
    +    for (sortMergeJoinEnabled <- Seq(true, false)) {
    --- End diff --
    
    This refactors this test to explicitly disable SMJ; this is necessary due 
to the defaults change.


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

Reply via email to