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

    https://github.com/apache/spark/pull/12081#discussion_r61971480
  
    --- 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")
    +      }
    +      new Path(new Path(defaultPath), database + ".db")
    +    }
    +    dbPath.toString.stripSuffix(File.separator)
    --- End diff --
    
    similarly I don't understand why we need to do this. What is the exception 
you see if we didn't strip the slash?


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