Shixiong Zhu created SPARK-10036:
------------------------------------
Summary: DataFrameReader.json and DataFrameWriter.json don't load
the JDBC driver class before creating JDBC connection
Key: SPARK-10036
URL: https://issues.apache.org/jira/browse/SPARK-10036
Project: Spark
Issue Type: Bug
Components: SQL
Reporter: Shixiong Zhu
Here is the reproduce code and the stack trace
{code}
val url = "jdbc:postgresql://.../mytest"
import java.util.Properties
val prop = new Properties()
prop.put("driver", "org.postgresql.Driver")
prop.put("user", "...")
prop.put("password", "...")
val df = sqlContext.read.jdbc(url, "mytest", prop)
{code}
{code}
java.sql.SQLException: No suitable driver found for jdbc:postgresql://.../mytest
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at
org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:121)
at
org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.<init>(JDBCRelation.scala:91)
at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:200)
at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:130)
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]