Repository: spark
Updated Branches:
  refs/heads/master 1e43851d6 -> e5949c287


[SPARK-6966][SQL] Use correct ClassLoader for JDBC Driver

Otherwise we cannot add jars with drivers after the fact.

Author: Michael Armbrust <mich...@databricks.com>

Closes #5543 from marmbrus/jdbcClassloader and squashes the following commits:

d9930f3 [Michael Armbrust] fix imports
73d0614 [Michael Armbrust] [SPARK-6966][SQL] Use correct ClassLoader for JDBC 
Driver


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e5949c28
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e5949c28
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e5949c28

Branch: refs/heads/master
Commit: e5949c287ed19e78b6eecc61c3e88a07ad452eb9
Parents: 1e43851
Author: Michael Armbrust <mich...@databricks.com>
Authored: Thu Apr 16 17:59:49 2015 -0700
Committer: Michael Armbrust <mich...@databricks.com>
Committed: Thu Apr 16 17:59:49 2015 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e5949c28/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala
----------------------------------------------------------------------
diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala 
b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala
index 99b755c..5f48008 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala
@@ -28,6 +28,7 @@ import org.apache.spark.sql.SQLContext
 import org.apache.spark.sql.catalyst.expressions.Row
 import org.apache.spark.sql.sources._
 import org.apache.spark.sql.types.StructType
+import org.apache.spark.util.Utils
 
 /**
  * Data corresponding to one partition of a JDBCRDD.
@@ -99,7 +100,7 @@ private[sql] class DefaultSource extends RelationProvider {
     val upperBound = parameters.getOrElse("upperBound", null)
     val numPartitions = parameters.getOrElse("numPartitions", null)
 
-    if (driver != null) Class.forName(driver)
+    if (driver != null) Utils.getContextOrSparkClassLoader.loadClass(driver)
 
     if (partitionColumn != null
         && (lowerBound == null || upperBound == null || numPartitions == 
null)) {


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

Reply via email to