diff options
author | Reynold Xin <rxin@databricks.com> | 2015-06-01 21:35:55 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-06-01 21:35:55 -0700 |
commit | 75dda33f3e037d550c4ab55d438661070804c717 (patch) | |
tree | e6a91fa1347d5050a4d4f6a9bbb502813fdd4708 /sql/core | |
parent | 91f6be87bc5cff41ca7a9cca9fdcc4678a4e7086 (diff) | |
download | spark-75dda33f3e037d550c4ab55d438661070804c717.tar.gz spark-75dda33f3e037d550c4ab55d438661070804c717.tar.bz2 spark-75dda33f3e037d550c4ab55d438661070804c717.zip |
Revert "[SPARK-8020] Spark SQL in spark-defaults.conf make metadataHive get constructed too early"
This reverts commit 91f6be87bc5cff41ca7a9cca9fdcc4678a4e7086.
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala index 91e6385dec..7384b24c50 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala @@ -182,28 +182,9 @@ class SQLContext(@transient val sparkContext: SparkContext) conf.dialect } - { - // We extract spark sql settings from SparkContext's conf and put them to - // Spark SQL's conf. - // First, we populate the SQLConf (conf). So, we can make sure that other values using - // those settings in their construction can get the correct settings. - // For example, metadataHive in HiveContext may need both spark.sql.hive.metastore.version - // and spark.sql.hive.metastore.jars to get correctly constructed. - val properties = new Properties - sparkContext.getConf.getAll.foreach { - case (key, value) if key.startsWith("spark.sql") => properties.setProperty(key, value) - case _ => - } - // We directly put those settings to conf to avoid of calling setConf, which may have - // side-effects. For example, in HiveContext, setConf may cause executionHive and metadataHive - // get constructed. If we call setConf directly, the constructed metadataHive may have - // wrong settings, or the construction may fail. - conf.setConf(properties) - // After we have populated SQLConf, we call setConf to populate other confs in the subclass - // (e.g. hiveconf in HiveContext). - properties.foreach { - case (key, value) => setConf(key, value) - } + sparkContext.getConf.getAll.foreach { + case (key, value) if key.startsWith("spark.sql") => setConf(key, value) + case _ => } @transient |