Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19567#discussion_r147578399
  
    --- 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 --
    
    nit: `if (obj == null) null else UTF8String.fromString(obj.toString)`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to