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

    https://github.com/apache/spark/pull/20174#discussion_r160305419
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
 ---
    @@ -230,6 +236,7 @@ case class HashAggregateExec(
              | private void $doAgg() throws java.io.IOException {
              |   // initialize aggregation buffer
              |   $initBufVar
    +         |   $hasInput = false;
    --- End diff --
    
    If the result expression is empty and `hasInput` is `false`, it should 
return an empty iterator (this is exactly the corner case we want to fix). If 
the result expression is empty but `hasInput` is `true`, it should append empty 
rows.  


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to