diff options
author | Yin Huai <huai@cse.ohio-state.edu> | 2014-08-08 11:15:16 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-08-08 11:15:16 -0700 |
commit | c874723fa844b49f057bb2434a12228b2f717e99 (patch) | |
tree | f638720a92dc62f86eda7fd1048a0003bda866c9 /sql/hive | |
parent | 0489cee6b24ca34f1adab03a75d157e04a9e06b7 (diff) | |
download | spark-c874723fa844b49f057bb2434a12228b2f717e99.tar.gz spark-c874723fa844b49f057bb2434a12228b2f717e99.tar.bz2 spark-c874723fa844b49f057bb2434a12228b2f717e99.zip |
[SPARK-2877] [SQL] MetastoreRelation should use SparkClassLoader when creating the tableDesc
JIRA: https://issues.apache.org/jira/browse/SPARK-2877
Author: Yin Huai <huai@cse.ohio-state.edu>
Closes #1806 from yhuai/SPARK-2877 and squashes the following commits:
4142bcb [Yin Huai] Use Spark's classloader.
Diffstat (limited to 'sql/hive')
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala index 301cf51c00..82e9c1a248 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala @@ -19,8 +19,6 @@ package org.apache.spark.sql.hive import scala.util.parsing.combinator.RegexParsers -import org.apache.hadoop.fs.Path -import org.apache.hadoop.hive.conf.HiveConf import org.apache.hadoop.hive.metastore.api.{FieldSchema, StorageDescriptor, SerDeInfo} import org.apache.hadoop.hive.metastore.api.{Table => TTable, Partition => TPartition} import org.apache.hadoop.hive.ql.metadata.{Hive, Partition, Table} @@ -39,6 +37,7 @@ import org.apache.spark.sql.catalyst.rules._ import org.apache.spark.sql.catalyst.types._ import org.apache.spark.sql.columnar.InMemoryRelation import org.apache.spark.sql.hive.execution.HiveTableScan +import org.apache.spark.util.Utils /* Implicit conversions */ import scala.collection.JavaConversions._ @@ -288,7 +287,10 @@ private[hive] case class MetastoreRelation ) val tableDesc = new TableDesc( - Class.forName(hiveQlTable.getSerializationLib).asInstanceOf[Class[Deserializer]], + Class.forName( + hiveQlTable.getSerializationLib, + true, + Utils.getContextOrSparkClassLoader).asInstanceOf[Class[Deserializer]], hiveQlTable.getInputFormatClass, // The class of table should be org.apache.hadoop.hive.ql.metadata.Table because // getOutputFormatClass will use HiveFileFormatUtils.getOutputFormatSubstitute to |