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

    https://github.com/apache/spark/pull/19567#discussion_r147560424
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
 ---
    @@ -456,8 +456,17 @@ object JdbcUtils extends Logging {
     
             case StringType =>
               (array: Object) =>
    -            array.asInstanceOf[Array[java.lang.String]]
    -              .map(UTF8String.fromString)
    +            array match {
    --- End diff --
    
    looking at how we handle StringType, we call `ResultSet.getString` even if 
the underling type is not string, but uuid, inet, cidr, etc. I think we shoud 
follow the behavior here, i.e. just call 
`array.asInstanceOf[Array[java.lang.Object]].map(obj => 
UTF8String.fromString(obj.toString))`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to