Github user yhuai commented on a diff in the pull request: https://github.com/apache/spark/pull/15024#discussion_r86066888 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala --- @@ -196,18 +196,32 @@ class InMemoryCatalog( throw new TableAlreadyExistsException(db = db, table = table) } } else { - if (tableDefinition.tableType == CatalogTableType.MANAGED) { - val dir = new Path(catalog(db).db.locationUri, table) + // Set the default table location if this is a managed table and its location is not + // specified. + // Ideally we should not create a managed table with location, but Hive serde table can + // specify location for managed table. And in [[CreateDataSourceTableAsSelectCommand]] we have + // to create the table directory and write out data before we create this table, to avoid + // exposing a partial written table. + val needDefaultTableLocation = + tableDefinition.tableType == CatalogTableType.MANAGED && --- End diff -- indentation
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org