Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/19567#discussion_r147309380
--- 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 {
+ case _: Array[java.lang.String] =>
+ array.asInstanceOf[Array[java.lang.String]]
+ .map(UTF8String.fromString)
+ case _: Array[java.util.UUID] =>
+ array.asInstanceOf[Array[java.util.UUID]]
+ .map(uuid => UTF8String.fromString(uuid.toString))
+ case _ =>
--- End diff --
I can't currently take a close look now (it's mobile) but is it safe (or
related) to allow the conversion from obj to string?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]