File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
core/src/main/scala/org/apache/spark/sql/catalyst Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,15 @@ object CatalystTypeConverters {
8282 final def toCatalyst (@ Nullable maybeScalaValue : Any ): CatalystType = {
8383 if (maybeScalaValue == null ) {
8484 null .asInstanceOf [CatalystType ]
85- } else if ( maybeScalaValue. isInstanceOf [ Option [ ScalaInputType ]]) {
86- val opt = maybeScalaValue. asInstanceOf [ Option [ScalaInputType ]]
87- if (opt.isDefined) {
88- toCatalystImpl(opt.get)
89- } else {
90- null .asInstanceOf [CatalystType ]
91- }
92- } else {
93- toCatalystImpl(maybeScalaValue.asInstanceOf [ScalaInputType ])
85+ } else maybeScalaValue match {
86+ case opt : Option [ScalaInputType ] =>
87+ if (opt.isDefined) {
88+ toCatalystImpl(opt.get)
89+ } else {
90+ null .asInstanceOf [CatalystType ]
91+ }
92+ case _ =>
93+ toCatalystImpl(maybeScalaValue.asInstanceOf [ScalaInputType ])
9494 }
9595 }
9696
You can’t perform that action at this time.
0 commit comments