File tree Expand file tree Collapse file tree
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,16 +313,16 @@ class SessionCatalog(
313313
314314 def validateTableLocation (table : CatalogTable ): Unit = {
315315 // SPARK-19724: the default location of a managed table should be non-existent or empty.
316- if (table.tableType == CatalogTableType .MANAGED && ! conf.allowNonemptyManagedTableLocation) {
317- val tableLocation =
318- new Path (table.storage.locationUri.getOrElse(defaultTablePath(table.identifier)))
319- val fs = tableLocation.getFileSystem(hadoopConf)
320-
321- if (fs.exists(tableLocation) && fs.listStatus(tableLocation).nonEmpty) {
322- throw new AnalysisException (s " Can not create the managed table(' ${table.identifier}') " +
323- s " . The associated location(' ${tableLocation.toString}') already exists. " )
324- }
325- }
316+ if (table.tableType == CatalogTableType .MANAGED && ! conf.allowNonemptyManagedTableLocation) {
317+ val tableLocation =
318+ new Path (table.storage.locationUri.getOrElse(defaultTablePath(table.identifier)))
319+ val fs = tableLocation.getFileSystem(hadoopConf)
320+
321+ if (fs.exists(tableLocation) && fs.listStatus(tableLocation).nonEmpty) {
322+ throw new AnalysisException (s " Can not create the managed table(' ${table.identifier}') " +
323+ s " . The associated location(' ${tableLocation.toString}') already exists. " )
324+ }
325+ }
326326 }
327327
328328 /**
You can’t perform that action at this time.
0 commit comments