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

    https://github.com/apache/spark/pull/19813#discussion_r154257537
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
 ---
    @@ -115,9 +116,35 @@ abstract class Expression extends TreeNode[Expression] 
{
         }
       }
     
    +  /**
    +   * Records current input row and variables for this expression into 
created `ExprCode`.
    +   */
    +  private def populateInputs(ctx: CodegenContext, eval: ExprCode): Unit = {
    +    if (ctx.INPUT_ROW != null) {
    +      eval.inputRow = ctx.INPUT_ROW
    +    }
    +    if (ctx.currentVars != null) {
    +      val boundRefs = this.collect {
    +        case b @ BoundReference(ordinal, _, _) if ctx.currentVars(ordinal) 
!= null => (ordinal, b)
    +      }.toMap
    +
    +      ctx.currentVars.zipWithIndex.filter(_._1 != null).foreach { case 
(currentVar, idx) =>
    --- End diff --
    
    ctx.INPUT_ROW can possibly be null.


---

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

Reply via email to