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

    https://github.com/apache/spark/pull/11403#discussion_r55242312
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 
---
    @@ -1318,6 +1318,34 @@ class DataFrameSuite extends QueryTest with 
SharedSQLContext {
     
       }
     
    +  test("reuse exchange") {
    +    withSQLConf("spark.sql.autoBroadcastJoinThreshold" -> "2") {
    +      val df = sqlContext.range(100)
    +      val join = df.join(df, "id")
    +      val plan = join.queryExecution.executedPlan
    +      checkAnswer(join, df)
    +      assert(
    +        join.queryExecution.executedPlan.collect { case e: ShuffleExchange 
=> true }.size === 1)
    +      assert(join.queryExecution.executedPlan.collect { case e: 
ReusedExchange => true }.size === 1)
    +      val broadcasted = broadcast(join)
    +      val join2 = join.join(broadcasted, "id").join(broadcasted, "id")
    +      checkAnswer(join2, df)
    +      assert(
    +        join2.queryExecution.executedPlan.collect { case e: 
ShuffleExchange => true }.size === 1)
    +      assert(
    +        join2.queryExecution.executedPlan.collect { case e: 
BroadcastExchange => true }.size === 1)
    +      assert(
    +        join2.queryExecution.executedPlan.collect { case e: ReusedExchange 
=> true }.size === 4)
    +    }
    +  }
    +
    +  test("same result on aggregate") {
    --- End diff --
    
    This test is to make sure sameResult() on two aggregates with different 
ExprIds should return true.


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