-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-19664][SQL]put hive.metastore.warehouse.dir in hadoopconf to overwrite its original value #16996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-19664][SQL]put hive.metastore.warehouse.dir in hadoopconf to overwrite its original value #16996
Changes from 2 commits
92c1452
ac0a1c6
91b9fd2
7429cd8
26ba212
1d18636
86deb62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ private[sql] class SharedState(val sparkContext: SparkContext) extends Logging { | |
| val warehousePath = { | ||
| val configFile = Utils.getContextOrSparkClassLoader.getResource("hive-site.xml") | ||
| if (configFile != null) { | ||
| logInfo(s"load config from hive-site.xml $configFile") | ||
| sparkContext.hadoopConfiguration.addResource(configFile) | ||
| } | ||
|
|
||
|
|
@@ -61,6 +62,12 @@ private[sql] class SharedState(val sparkContext: SparkContext) extends Logging { | |
| // When neither spark.sql.warehouse.dir nor hive.metastore.warehouse.dir is set, | ||
| // we will set hive.metastore.warehouse.dir to the default value of spark.sql.warehouse.dir. | ||
| val sparkWarehouseDir = sparkContext.conf.get(WAREHOUSE_PATH) | ||
| logInfo(s"${WAREHOUSE_PATH.key} is set, Setting " + | ||
|
||
| s"hive.metastore.warehouse.dir ($hiveWarehouseDir) to the value of " + | ||
| s"${WAREHOUSE_PATH.key} ('$sparkWarehouseDir').") | ||
| if (hiveWarehouseDir != null) { | ||
| sparkContext.hadoopConfiguration.set("hive.metastore.warehouse.dir", sparkWarehouseDir) | ||
|
||
| } | ||
| sparkContext.conf.set("hive.metastore.warehouse.dir", sparkWarehouseDir) | ||
|
||
| sparkWarehouseDir | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
loading hive config file: $configFile