@@ -19,8 +19,6 @@ package org.apache.spark.sql.hive
19
19
20
20
import scala .util .parsing .combinator .RegexParsers
21
21
22
- import org .apache .hadoop .fs .Path
23
- import org .apache .hadoop .hive .conf .HiveConf
24
22
import org .apache .hadoop .hive .metastore .api .{FieldSchema , StorageDescriptor , SerDeInfo }
25
23
import org .apache .hadoop .hive .metastore .api .{Table => TTable , Partition => TPartition }
26
24
import org .apache .hadoop .hive .ql .metadata .{Hive , Partition , Table }
@@ -39,6 +37,7 @@ import org.apache.spark.sql.catalyst.rules._
39
37
import org .apache .spark .sql .catalyst .types ._
40
38
import org .apache .spark .sql .columnar .InMemoryRelation
41
39
import org .apache .spark .sql .hive .execution .HiveTableScan
40
+ import org .apache .spark .util .Utils
42
41
43
42
/* Implicit conversions */
44
43
import scala .collection .JavaConversions ._
@@ -288,7 +287,10 @@ private[hive] case class MetastoreRelation
288
287
)
289
288
290
289
val tableDesc = new TableDesc (
291
- Class .forName(hiveQlTable.getSerializationLib).asInstanceOf [Class [Deserializer ]],
290
+ Class .forName(
291
+ hiveQlTable.getSerializationLib,
292
+ true ,
293
+ Utils .getContextOrSparkClassLoader).asInstanceOf [Class [Deserializer ]],
292
294
hiveQlTable.getInputFormatClass,
293
295
// The class of table should be org.apache.hadoop.hive.ql.metadata.Table because
294
296
// getOutputFormatClass will use HiveFileFormatUtils.getOutputFormatSubstitute to
0 commit comments