yaooqinn commented on a change in pull request #28527:
URL: https://github.com/apache/spark/pull/28527#discussion_r463497620
##########
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:
the warehousePath can accept a relative path, the `fullPath` might not
be qualified yet
----------------------------------------------------------------
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]