Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix udts.
  • Loading branch information
ueshin committed Jul 11, 2018
commit db254e582775d8715a945ab1b48fb8587c8e934a
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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