eatoncys commented on a change in pull request #24238:
[SPARK-27320][SQL]Replacing index with iterator to traverse the expressions
list in AggregationIterator, which make it simpler
URL: https://github.com/apache/spark/pull/24238#discussion_r270264740
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggregationIterator.scala
##########
@@ -74,13 +74,12 @@ abstract class AggregationIterator(
startingInputBufferOffset: Int): Array[AggregateFunction] = {
var mutableBufferOffset = 0
var inputBufferOffset: Int = startingInputBufferOffset
- val expressionsLength = expressions.length
- val functions = new Array[AggregateFunction](expressionsLength)
+ val functions = new Array[AggregateFunction](expressions.length)
var i = 0
val inputAttributeSeq: AttributeSeq = inputAttributes
- while (i < expressionsLength) {
- val func = expressions(i).aggregateFunction
- val funcWithBoundReferences: AggregateFunction = expressions(i).mode
match {
+ for (expression <- expressions) {
Review comment:
Fixed, thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]