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

    https://github.com/apache/spark/pull/19811#discussion_r156930498
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -189,15 +255,37 @@ class CodegenContext {
       def declareMutableStates(): String = {
         // It's possible that we add same mutable state twice, e.g. the 
`mergeExpressions` in
         // `TypedAggregateExpression`, we should call `distinct` here to 
remove the duplicated ones.
    -    mutableStates.distinct.map { case (javaType, variableName, _) =>
    +    val inlinedStates = mutableStates.distinct.map { case (javaType, 
variableName) =>
           s"private $javaType $variableName;"
    -    }.mkString("\n")
    +    }
    +
    +    val arrayStates = mutableStateArrayMap.flatMap { case (javaType, 
mutableStateArrays) =>
    +      val numArrays = mutableStateArrays.arrayNames.size
    +      mutableStateArrays.arrayNames.zipWithIndex.map { case (arrayName, 
index) =>
    +        val length = if (index + 1 == numArrays) {
    +          mutableStateArrays.getCurrentIndex
    +        } else {
    +          CodeGenerator.MUTABLESTATEARRAY_SIZE_LIMIT
    --- End diff --
    
    sorry, stupid question.


---

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

Reply via email to