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

    https://github.com/apache/spark/pull/15032#discussion_r78267647
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggregationIterator.scala
 ---
    @@ -181,11 +182,7 @@ abstract class AggregationIterator(
             // Process all expression-based aggregate functions.
             updateProjection.target(currentBuffer)(joinedRow(currentBuffer, 
row))
             // Process all imperative aggregate functions.
    -        var i = 0
    -        while (i < updateFunctions.length) {
    -          updateFunctions(i)(currentBuffer, row)
    -          i += 1
    -        }
    +        updateFunctions.foreach(updateFunction => 
updateFunction(currentBuffer, row))
    --- End diff --
    
    For [1], it's written as below and it seems including functional 
transformations
    > Use while loops instead of for loops or functional transformations (e.g. 
`map`, `foreach`).
    
    Then, could you then confirm the bytecode is virtually the same or more 
efficient? My point was that I think we need a clear reason in this case.
    



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