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

    https://github.com/apache/spark/pull/19797#discussion_r152865836
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
 ---
    @@ -87,14 +87,13 @@ private [sql] object GenArrayData {
           elementType: DataType,
           elementsCode: Seq[ExprCode],
           isMapKey: Boolean): (String, Seq[String], String, String) = {
    -    val arrayName = ctx.freshName("array")
         val arrayDataName = ctx.freshName("arrayData")
         val numElements = elementsCode.length
     
         if (!ctx.isPrimitiveType(elementType)) {
    +      val arrayName = "arrayObject"
           val genericArrayClass = classOf[GenericArrayData].getName
    -      ctx.addMutableState("Object[]", arrayName,
    -        s"$arrayName = new Object[$numElements];")
    +      ctx.reuseOrAddMutableState("Object[]", arrayName)
    --- End diff --
    
    It is [my 
question](https://github.com/apache/spark/pull/19797#discussion_r152627225).
    Which one do you suggest?


---

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

Reply via email to