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

    https://github.com/apache/spark/pull/22466#discussion_r220795973
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
    @@ -66,6 +66,19 @@ case class CreateDatabaseCommand(
       extends RunnableCommand {
     
       override def run(sparkSession: SparkSession): Seq[Row] = {
    +    // SPARK-25464 fail if DB location exists and is not empty
    +    if (path.isDefined) {
    --- End diff --
    
    I think we should only block the last two cases. I also prefer to doing it 
in the external catalog. In the future, if we support catalog federation, 
different external catalog can define their own behavior. 
    
    Listing files in S3 is expensive, but create a new database is not 
frequent. I think our users can accept this cost. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to