spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #15993: [SPARK-18050][SQL] do not create default database...
Date Thu, 24 Nov 2016 02:10:40 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15993#discussion_r89426408
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala ---
    @@ -92,8 +92,12 @@ private[sql] class SharedState(val sparkContext: SparkContext) extends
Logging {
       {
         val defaultDbDefinition = CatalogDatabase(
           SessionCatalog.DEFAULT_DATABASE, "default database", warehousePath, Map())
    -    // Initialize default database if it doesn't already exist
    -    externalCatalog.createDatabase(defaultDbDefinition, ignoreIfExists = true)
    +    // Initialize default database if it doesn't exist
    +    if (!externalCatalog.databaseExists(SessionCatalog.DEFAULT_DATABASE)) {
    --- End diff --
    
    checking existence and then creating database is not atomic. It's ok here because we can't
drop default database, but it may not work for general `createDatabase`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message