From c9ed1bed09e8f4cfede18dc677bb8ef89992df23 Mon Sep 17 00:00:00 2001 From: Konstantin Vedernikov <75157521+scanhex12@users.noreply.github.com> Date: Sat, 5 Jul 2025 05:25:27 +0000 Subject: [PATCH] Merge pull request #83298 from scanhex12/do_not_throw_iceberg Do not throw exception on connection with incorrect iceberg database --- src/Databases/DataLake/DatabaseDataLake.cpp | 26 +++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Databases/DataLake/DatabaseDataLake.cpp b/src/Databases/DataLake/DatabaseDataLake.cpp index 7a686c2bb04b..6bca0928a4e9 100644 --- a/src/Databases/DataLake/DatabaseDataLake.cpp +++ b/src/Databases/DataLake/DatabaseDataLake.cpp @@ -453,7 +453,18 @@ DatabaseTablesIteratorPtr DatabaseDataLake::getTablesIterator( { Tables tables; auto catalog = getCatalog(); - const auto iceberg_tables = catalog->getTables(); + DB::Names iceberg_tables; + + /// Do not throw here, because this might be, for example, a query to system.tables. + /// It must not fail on case of some datalake error. + try + { + iceberg_tables = catalog->getTables(); + } + catch (...) + { + tryLogCurrentException(__PRETTY_FUNCTION__); + } for (const auto & table_name : iceberg_tables) { @@ -479,7 +490,18 @@ DatabaseTablesIteratorPtr DatabaseDataLake::getLightweightTablesIterator( { Tables tables; auto catalog = getCatalog(); - const auto iceberg_tables = catalog->getTables(); + DB::Names iceberg_tables; + + /// Do not throw here, because this might be, for example, a query to system.tables. + /// It must not fail on case of some datalake error. + try + { + iceberg_tables = catalog->getTables(); + } + catch (...) + { + tryLogCurrentException(__PRETTY_FUNCTION__); + } for (const auto & table_name : iceberg_tables) {