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

    https://github.com/apache/spark/pull/20771#discussion_r173156834
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
 ---
    @@ -501,12 +502,22 @@ case class LambdaVariable(
         value: String,
         isNull: String,
         dataType: DataType,
    -    nullable: Boolean = true) extends LeafExpression
    -  with Unevaluable with NonSQLExpression {
    +    nullable: Boolean = true) extends LeafExpression with NonSQLExpression 
{
    +
    +  // Interpreted execution of `LambdaVariable` always get the 0-index 
element from input row.
    +  override def eval(input: InternalRow): Any = {
    +    assert(input.numFields == 1,
    +      "The input row of interpreted LambdaVariable should have only 1 
field.")
    +    input.get(0, dataType)
    --- End diff --
    
    Not a change for this PR. Maybe we should use accessors here? This uses a 
matching under the hood and is slower than virtual function dispatch. 
Implementing this would also be useful for BoundReference for example. 


---

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

Reply via email to