Skip to content

Commit

Permalink
rename a conf name
Browse files Browse the repository at this point in the history
  • Loading branch information
windpiger committed Feb 20, 2017
1 parent aebdfc6 commit 825c0ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ object SQLConf {
.createWithDefault(TimeZone.getDefault().getID())

// for test
val HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH =
buildConf("spark.hive.createTable.defaultDB.location.useWarehousePath")
val TEST_HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH =
buildConf("spark.hive.test.createTable.defaultDB.location.useWarehousePath")
.doc("Enables test case to use warehouse path instead of db location when " +
"create table in default database.")
.booleanConf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
// if the database is default, the value of WAREHOUSE_PATH in conf returned
private def defaultTablePath(tableIdent: TableIdentifier): String = {
val dbLocation = if (tableIdent.database.get == SessionCatalog.DEFAULT_DATABASE
|| conf.get(SQLConf.HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH)) {
|| conf.get(SQLConf.TEST_HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH)) {
conf.get(WAREHOUSE_PATH)
} else {
getDatabase(tableIdent.database.get).locationUri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ class HiveDDLSuite
withTable("t") {
withTempDir { dir =>
spark.sparkContext.conf
.set(SQLConf.HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH.key, "true")
.set(SQLConf.TEST_HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH.key, "true")

spark.sql(s"CREATE DATABASE default_test LOCATION '$dir'" )
val db = spark.sessionState.catalog.getDatabaseMetadata("default_test")
Expand All @@ -1606,7 +1606,7 @@ class HiveDDLSuite

// clear
spark.sparkContext.conf
.remove(SQLConf.HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH.key)
.remove(SQLConf.TEST_HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH.key)
spark.sql("DROP TABLE t")
spark.sql("DROP DATABASE default_test")
spark.sql("USE DEFAULT")
Expand All @@ -1624,8 +1624,6 @@ class HiveDDLSuite
assert(table.location.stripSuffix("/") == s"${db.locationUri.stripSuffix("/")}/t" )

// clear
spark.sparkContext.conf
.remove(SQLConf.HIVE_CREATETABLE_DEFAULTDB_USEWAREHOUSE_PATH.key)
spark.sql("DROP TABLE t")
spark.sql("DROP DATABASE test_not_default")
spark.sql("USE DEFAULT")
Expand Down

0 comments on commit 825c0ad

Please sign in to comment.