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

    https://github.com/apache/spark/pull/19813#discussion_r154948628
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
 ---
    @@ -115,9 +120,35 @@ abstract class Expression extends TreeNode[Expression] 
{
         }
       }
     
    +  /**
    +   * Returns the input variables to this expression.
    +   */
    +  private def findInputVars(ctx: CodegenContext, eval: ExprCode): 
Seq[ExprInputVar] = {
    +    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).flatMap { case 
(currentVar, idx) =>
    --- End diff --
    
    Why these codes? to make sure the returned input vars follow the same order 
in `ctx.currentVars`?


---

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

Reply via email to