File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
sql/core/src/main/scala/org/apache/spark/sql/jdbc Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ package org.apache.spark.sql.jdbc
2020import java .sql .DriverManager
2121import java .util .Properties
2222
23+ import org .apache .spark .util .Utils
24+
2325import scala .collection .mutable .ArrayBuffer
2426
2527import org .apache .spark .Partition
@@ -99,7 +101,7 @@ private[sql] class DefaultSource extends RelationProvider {
99101 val upperBound = parameters.getOrElse(" upperBound" , null )
100102 val numPartitions = parameters.getOrElse(" numPartitions" , null )
101103
102- if (driver != null ) Class .forName (driver)
104+ if (driver != null ) Utils .getContextOrSparkClassLoader.loadClass (driver)
103105
104106 if (partitionColumn != null
105107 && (lowerBound == null || upperBound == null || numPartitions == null )) {
You can’t perform that action at this time.
0 commit comments