Github user jmchung commented on a diff in the pull request:
https://github.com/apache/spark/pull/19567#discussion_r147579149
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
---
@@ -456,8 +456,10 @@ object JdbcUtils extends Logging {
case StringType =>
(array: Object) =>
- array.asInstanceOf[Array[java.lang.String]]
- .map(UTF8String.fromString)
+ // some underling types are not String such as uuid, inet,
cidr, etc.
+ array.asInstanceOf[Array[java.lang.Object]]
+ .map(obj => UTF8String.fromString(
+ if (obj == null) null else obj.toString))
--- End diff --
Thanks @cloud-fan !
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]