Github user chutium commented on a diff in the pull request:
https://github.com/apache/spark/pull/1612#discussion_r15451376
--- Diff: core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala ---
@@ -67,6 +69,28 @@ class JdbcRDD[T: ClassTag](
}).toArray
}
+ def getSchema: Seq[(String, Int, Boolean)] = {
--- End diff --
here i tried to return a java.sql.ResultSetMetaData object, then build the
Seq[(String, Int, Boolean)] for schemaRDD in Spark SQL scope, but when i run
this SchemaRDD, i got "java.io.NotSerializableException:
org.postgresql.jdbc4.Jdbc4ResultSetMetaData"
so i let this method return a Seq[(String, Int, Boolean)], and in Spark SQL
scope, create Seq[StructField] from this Seq[(String, Int, Boolean)]
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---