Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12081#discussion_r61991923
  
    --- 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 = {
    --- End diff --
    
    I did try it, but it involves a lot of code changes. 
    
    The major issue is the type mismatch between the `path` in `case class 
CreateDatabase` and the `locationUri` in `CatalogDatabase`. The first one has 
to be `Option[String]` since users might not provide `location` in the create 
table command. The second one has to be `String` since we always have the 
`location`. 
    
    
https://github.com/gatorsmile/spark/blob/mkdir/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala#L63
    
    If we change the type of `locationUri` in `CatalogDatabase` to 
`Option[String]`, the related code changes look not clean.


---
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]

Reply via email to