Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/12081#discussion_r61983027
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
---
@@ -148,9 +148,17 @@ class SessionCatalog(
currentDb = db
}
- def getDefaultDBPath(db: String): String = {
+ /** Get the path for creating a non-default database. */
+ def createDatabasePath(db: String, path: Option[String]): String = {
val database = if (conf.caseSensitiveAnalysis) db else db.toLowerCase
- new Path(new Path(conf.warehousePath), database + ".db").toString
+ val dbPath = path.map(new Path(_)).getOrElse {
+ val defaultPath = conf.warehousePath
+ if (org.apache.commons.lang.StringUtils.isBlank(defaultPath)) {
+ throw new AnalysisException("spark.sql.warehouse.dir is blank")
--- End diff --
This is from what Hive metastore is doing.
https://github.com/apache/hive/blob/134b6cccbd7237901f7f7594626796863ca0150a/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java#L74-L77
I also have the same question like you. Let me remove it since we do not
follow what Hive is doing.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]