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

    https://github.com/apache/spark/pull/20736#discussion_r172192400
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
 ---
    @@ -382,8 +382,14 @@ case class UnwrapOption(
     
       override def inputTypes: Seq[AbstractDataType] = ObjectType :: Nil
     
    -  override def eval(input: InternalRow): Any =
    -    throw new UnsupportedOperationException("Only code-generated 
evaluation is supported")
    +  override def eval(input: InternalRow): Any = {
    +    val inputObject = child.eval(input)
    --- End diff --
    
    thanks for your comment. I haven't used pattern matching because it is a 
bit slower than using if...else and I'd prefer the fastest way here. What do 
you think?


---

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

Reply via email to