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

    https://github.com/apache/spark/pull/19827#discussion_r153385444
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
 ---
    @@ -167,9 +160,20 @@ object GenerateUnsafeProjection extends 
CodeGenerator[Seq[Expression], UnsafePro
             }
         }
     
    +    val writeFieldsCode = if (isTopLevel && row == null) {
    --- End diff --
    
     The `INPUT_ROW` of this local codegen context is not changed in 
`GenerateUnsafeProjection`. If it is `null`, the generated code will become:
    
    ```scala
    class SpecificUnsafeProjection extends ${classOf[UnsafeProjection].getName} 
{
      ...
      public UnsafeRow apply(InternalRow null) {  // InternalRow 
${ctx.INPUT_ROW} here.
        ${eval.code.trim}
        return ${eval.value};
      }
      ...
    }
    ```


---

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

Reply via email to