File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ object ScalaReflection {
41
41
42
42
/** Returns a catalyst DataType for the given Scala Type using reflection. */
43
43
def schemaFor (tpe : `Type`): DataType = tpe match {
44
+ case t if t <:< typeOf[Option [_]] =>
45
+ val TypeRef (_, _, Seq (optType)) = t
46
+ schemaFor(optType)
44
47
case t if t <:< typeOf[Product ] =>
45
48
val params = t.member(" <init>" : TermName ).asMethod.paramss
46
49
StructType (
@@ -59,9 +62,6 @@ object ScalaReflection {
59
62
case t if t <:< typeOf[String ] => StringType
60
63
case t if t <:< typeOf[Timestamp ] => TimestampType
61
64
case t if t <:< typeOf[BigDecimal ] => DecimalType
62
- case t if t <:< typeOf[Option [_]] =>
63
- val TypeRef (_, _, Seq (optType)) = t
64
- schemaFor(optType)
65
65
case t if t <:< typeOf[java.lang.Integer ] => IntegerType
66
66
case t if t <:< typeOf[java.lang.Long ] => LongType
67
67
case t if t <:< typeOf[java.lang.Double ] => DoubleType
You can’t perform that action at this time.
0 commit comments