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

    https://github.com/apache/spark/pull/19869#discussion_r154534333
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
 ---
    @@ -672,48 +668,56 @@ case class HashAggregateExec(
     
         def outputFromRowBasedMap: String = {
           s"""
    -       while ($iterTermForFastHashMap.next()) {
    -         $numOutput.add(1);
    -         UnsafeRow $keyTerm = (UnsafeRow) $iterTermForFastHashMap.getKey();
    -         UnsafeRow $bufferTerm = (UnsafeRow) 
$iterTermForFastHashMap.getValue();
    -         $outputFunc($keyTerm, $bufferTerm);
    -
    -         if (shouldStop()) return;
    -       }
    -       $fastHashMapTerm.close();
    -     """
    +         |while ($iterTermForFastHashMap.next()) {
    +         |  UnsafeRow $keyTerm = (UnsafeRow) 
$iterTermForFastHashMap.getKey();
    +         |  UnsafeRow $bufferTerm = (UnsafeRow) 
$iterTermForFastHashMap.getValue();
    +         |  $outputFunc($keyTerm, $bufferTerm);
    +         |
    +         |  if (shouldStop()) return;
    +         |}
    +         |$fastHashMapTerm.close();
    +       """.stripMargin
         }
     
         // Iterate over the aggregate rows and convert them from ColumnarRow 
to UnsafeRow
         def outputFromVectorizedMap: String = {
             val row = ctx.freshName("fastHashMapRow")
    --- End diff --
    
    nit: Is it better to fix indentations for these three lines, too?


---

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

Reply via email to