Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/20736#discussion_r172188241
--- 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 --
NIT: you can also use pattern matching here. That saves you some typing:
```scala
child.eval(input) match {
case Some(value) => value
case _ => null
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]