Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19811#discussion_r156874375
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -154,6 +154,44 @@ class CodegenContext {
       val mutableStates: mutable.ArrayBuffer[(String, String, String)] =
         mutable.ArrayBuffer.empty[(String, String, String)]
     
    +  // An map keyed by mutable states' types holds the status of 
mutableStateArray
    +  var mutableStateArrayMap: mutable.Map[String, MutableStateArrays] =
    +    mutable.Map.empty[String, MutableStateArrays]
    +
    +  // An map keyed by mutable states' types holds the current name of the 
mutableStateArray
    +  // into which state of the given key will be compacted
    +  var mutableStateArrayCurrentNames: mutable.Map[String, String] =
    +    mutable.Map.empty[String, String]
    +
    +  // An array holds the code that will initialize each element of the 
mutableStateArray
    +  var mutableStateArrayInitCodes: mutable.ArrayBuffer[String] =
    +    mutable.ArrayBuffer.empty[String]
    +
    +  // Holding names and current index of mutableStateArrays for a certain 
type
    +  class MutableStateArrays {
    +    val arrayNames = mutable.ListBuffer.empty[String]
    +    createNewArray()
    +
    +    private[this] var currentIndex = 0
    +
    +    private def createNewArray() = 
arrayNames.append(freshName("mutableStateArray"))
    +
    +    def getCurrentIndex: Int = { currentIndex }
    --- End diff --
    
    nit `def getCurrentIndex: Int = currentIndex`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to