You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2017/10/28 17:56:31 UTC

[GitHub] spark pull request #19567: [SPARK-22291][SQL] PostgreSQL UUID[] to StringTyp...

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-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org