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

    https://github.com/apache/spark/pull/19811#discussion_r156876931
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
 ---
    @@ -73,9 +73,8 @@ object GenerateUnsafeProjection extends 
CodeGenerator[Seq[Expression], UnsafePro
           bufferHolder: String,
           isTopLevel: Boolean = false): String = {
         val rowWriterClass = classOf[UnsafeRowWriter].getName
    -    val rowWriter = ctx.freshName("rowWriter")
    -    ctx.addMutableState(rowWriterClass, rowWriter,
    -      s"$rowWriter = new $rowWriterClass($bufferHolder, 
${inputs.length});")
    +    val rowWriter = ctx.addMutableState(rowWriterClass, "rowWriter",
    +      v => s"$v = new $rowWriterClass($bufferHolder, ${inputs.length});", 
inline = true)
    --- End diff --
    
    why this has to be inlined?


---

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

Reply via email to