Skip to content

Commit

Permalink
Fix udts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ueshin committed Jul 11, 2018
1 parent 2ab025f commit db254e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Expand Up @@ -169,12 +169,6 @@ object TypeCoercion {
}
case _ => None
}
case (udt1: UserDefinedType[_], udt2: UserDefinedType[_]) =>
findTypeFunc(udt1.sqlType, udt2.sqlType)
case (udt1: UserDefinedType[_], _) =>
findTypeFunc(udt1.sqlType, t2)
case (_, udt2: UserDefinedType[_]) =>
findTypeFunc(t1, udt2.sqlType)
case _ => None
}

Expand Down
Expand Up @@ -186,7 +186,7 @@ object Literal {
case map: MapType => create(Map(), map)
case struct: StructType =>
create(InternalRow.fromSeq(struct.fields.map(f => default(f.dataType).value)), struct)
case udt: UserDefinedType[_] => default(udt.sqlType)
case udt: UserDefinedType[_] => Literal(default(udt.sqlType).value, udt)
case other =>
throw new RuntimeException(s"no default for type $dataType")
}
Expand Down

0 comments on commit db254e5

Please sign in to comment.