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 {
4141
4242 /** Returns a catalyst DataType for the given Scala Type using reflection. */
4343 def schemaFor (tpe : `Type`): DataType = tpe match {
44+ case t if t <:< typeOf[Option [_]] =>
45+ val TypeRef (_, _, Seq (optType)) = t
46+ schemaFor(optType)
4447 case t if t <:< typeOf[Product ] =>
4548 val params = t.member(" <init>" : TermName ).asMethod.paramss
4649 StructType (
@@ -59,9 +62,6 @@ object ScalaReflection {
5962 case t if t <:< typeOf[String ] => StringType
6063 case t if t <:< typeOf[Timestamp ] => TimestampType
6164 case t if t <:< typeOf[BigDecimal ] => DecimalType
62- case t if t <:< typeOf[Option [_]] =>
63- val TypeRef (_, _, Seq (optType)) = t
64- schemaFor(optType)
6565 case t if t <:< typeOf[java.lang.Integer ] => IntegerType
6666 case t if t <:< typeOf[java.lang.Long ] => LongType
6767 case t if t <:< typeOf[java.lang.Double ] => DoubleType
You can’t perform that action at this time.
0 commit comments