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

    https://github.com/apache/spark/pull/18920#discussion_r132878196
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala ---
    @@ -449,6 +451,49 @@ class DataFrameFunctionsSuite extends QueryTest with 
SharedSQLContext {
         ).foreach(assertValuesDoNotChangeAfterCoalesceOrUnion(_))
       }
     
    +  private def assertNoExceptions(c: Column): Unit = {
    +    for ((wholeStage, useObjectHashAgg) <-
    +         Seq((true, true), (true, false), (false, true), (false, false))) {
    +      withSQLConf(
    +        (SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key, wholeStage.toString),
    +        (SQLConf.USE_OBJECT_HASH_AGG.key, useObjectHashAgg.toString)) {
    +
    +        val df = Seq(("1", 1), ("1", 2), ("2", 3), ("2", 4)).toDF("x", "y")
    +
    +        // HashAggregate test case
    +        val hashAggDF = df.groupBy("x").agg(c, sum("y"))
    +        val hashAggPlan = hashAggDF.queryExecution.executedPlan
    +        if (wholeStage) {
    +          assert(hashAggPlan.find(p =>
    +            p.isInstanceOf[WholeStageCodegenExec] &&
    +              p.asInstanceOf[WholeStageCodegenExec].child
    +                .isInstanceOf[HashAggregateExec]).isDefined)
    --- End diff --
    
    ```Scala
              assert(hashAggPlan.find {
                case WholeStageCodegenExec(_: HashAggregateExec) => true
                case _ => false
              }.isDefined)
    ```


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