We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba13a59 commit 04898acCopy full SHA for 04898ac
core/src/main/scala/org/apache/spark/sql/catalyst/CatalystTypeConverters.scala
@@ -429,10 +429,11 @@ object CatalystTypeConverters {
429
// a measurable performance impact. Note that this optimization will be unnecessary if we
430
// use code generation to construct Scala Row -> Catalyst Row converters.
431
def convert(maybeScalaValue: Any): Any = {
432
- if (maybeScalaValue.isInstanceOf[Option[Any]]) {
433
- maybeScalaValue.asInstanceOf[Option[Any]].orNull
434
- } else {
435
- maybeScalaValue
+ maybeScalaValue match {
+ case option: Option[Any] =>
+ option.orNull
+ case _ =>
436
+ maybeScalaValue
437
}
438
439
0 commit comments