cloud-fan commented on a change in pull request #28527:
URL: https://github.com/apache/spark/pull/28527#discussion_r463501076
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -209,12 +209,20 @@ class SessionCatalog(
"you cannot create a database with this name.")
}
validateName(dbName)
- val qualifiedPath = makeQualifiedPath(dbDefinition.locationUri)
externalCatalog.createDatabase(
- dbDefinition.copy(name = dbName, locationUri = qualifiedPath),
+ dbDefinition.copy(name = dbName, locationUri =
makeQualifiedDBPath(dbDefinition.locationUri)),
ignoreIfExists)
}
+ private def makeQualifiedDBPath(locationUri: URI): URI = {
+ if (locationUri.isAbsolute) {
+ locationUri
+ } else {
+ val fullPath = new Path(conf.warehousePath,
CatalogUtils.URIToString(locationUri))
+ makeQualifiedPath(fullPath.toUri)
Review comment:
shall we make sure it's not relative? I think it's confusing if users
set a relative path to the warehouse path.
It's not related to this PR though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]