File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/databricks/labs/ucx/hive_metastore Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1+ import org .apache .spark .sql .catalyst .analysis .NoSuchDatabaseException
12import org .apache .spark .sql .catalyst .catalog .{CatalogTable , CatalogTableType }
23import org .apache .spark .sql .DataFrame
34
@@ -10,7 +11,13 @@ def metadataForAllTables(databases: Seq[String]): DataFrame = {
1011
1112 val externalCatalog = spark.sharedState.externalCatalog
1213 databases.par.flatMap(databaseName => {
13- val tables = externalCatalog.listTables(databaseName)
14+ val tables = try {
15+ externalCatalog.listTables(databaseName)
16+ } catch {
17+ case err : NoSuchDatabaseException =>
18+ println(s " [ERROR][ ${databaseName}] ignoring database because of ${err}" )
19+ null
20+ }
1421 if (tables == null ) {
1522 println(s " [WARN][ ${databaseName}] listTables returned null " )
1623 Seq ()
You can’t perform that action at this time.
0 commit comments