spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marmb...@apache.org
Subject spark git commit: [SPARK-7055][SQL]Use correct ClassLoader for JDBC Driver in JDBCRDD.getConnector
Date Thu, 23 Apr 2015 19:00:31 GMT
Repository: spark
Updated Branches:
  refs/heads/master 534f2a436 -> c1213e6a9


[SPARK-7055][SQL]Use correct ClassLoader for JDBC Driver in JDBCRDD.getConnector

Author: Vinod K C <vinod.kc@huawei.com>

Closes #5633 from vinodkc/use_correct_classloader_driverload and squashes the following commits:

73c5380 [Vinod K C] 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/c1213e6a
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c1213e6a
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c1213e6a

Branch: refs/heads/master
Commit: c1213e6a92e126ad886d9804cedaf6db3618e602
Parents: 534f2a4
Author: Vinod K C <vinod.kc@huawei.com>
Authored: Thu Apr 23 12:00:23 2015 -0700
Committer: Michael Armbrust <michael@databricks.com>
Committed: Thu Apr 23 12:00:23 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/spark/blob/c1213e6a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala
index b975191..f326510 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala
@@ -26,6 +26,7 @@ import org.apache.spark.rdd.RDD
 import org.apache.spark.sql.catalyst.expressions.{Row, SpecificMutableRow}
 import org.apache.spark.sql.types._
 import org.apache.spark.sql.sources._
+import org.apache.spark.util.Utils
 
 private[sql] object JDBCRDD extends Logging {
   /**
@@ -152,7 +153,7 @@ private[sql] object JDBCRDD extends Logging {
   def getConnector(driver: String, url: String, properties: Properties): () => Connection
= {
     () => {
       try {
-        if (driver != null) Class.forName(driver)
+        if (driver != null) Utils.getContextOrSparkClassLoader.loadClass(driver)
       } catch {
         case e: ClassNotFoundException => {
           logWarning(s"Couldn't find class $driver", e);


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


Mime
View raw message