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

    https://github.com/apache/spark/pull/9364#discussion_r43452642
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 
---
    @@ -987,4 +992,116 @@ class DataFrameSuite extends QueryTest with 
SharedSQLContext {
         val df = (1 to 10).map(Tuple1.apply).toDF("i").as("src")
         assert(df.select($"src.i".cast(StringType)).columns.head === "i")
       }
    +
    +  /**
    +   * Verifies that there is no Exchange between the Aggregations for `df`
    +   */
    +  private def verifyNonExchangingAgg(df: DataFrame) = {
    +    var atFirstAgg: Boolean = false
    +    df.queryExecution.executedPlan.foreach {
    +      case agg: TungstenAggregate => {
    +        atFirstAgg = !atFirstAgg
    +      }
    +      case _ => {
    +        if (atFirstAgg) {
    +          fail("Should not have operators between the two aggregations")
    +        }
    +      }
    +    }
    +  }
    +
    +  /**
    +   * Verifies that there is an Exchange between the Aggregations for `df`
    +   */
    +  private def verifyExchangingAgg(df: DataFrame) = {
    +    var atFirstAgg: Boolean = false
    +    df.queryExecution.executedPlan.foreach {
    +      case agg: TungstenAggregate => {
    +        if (atFirstAgg) {
    +          fail("Should not have back to back Aggregates")
    +        }
    +        atFirstAgg = true
    +      }
    +      case e: Exchange => atFirstAgg = false
    +      case _ =>
    +    }
    +  }
    +
    +  test("distributeBy") {
    --- End diff --
    
    `distributeBy and localSort`?


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

Reply via email to