Skip to content

Commit 3b41b34

Browse files
scanhex12mkmkme
authored andcommitted
Merge pull request ClickHouse#83298 from scanhex12/do_not_throw_iceberg
Do not throw exception on connection with incorrect iceberg database
1 parent f7fed0f commit 3b41b34

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/Databases/DataLake/DatabaseDataLake.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,18 @@ DatabaseTablesIteratorPtr DatabaseDataLake::getTablesIterator(
453453
{
454454
Tables tables;
455455
auto catalog = getCatalog();
456-
const auto iceberg_tables = catalog->getTables();
456+
DB::Names iceberg_tables;
457+
458+
/// Do not throw here, because this might be, for example, a query to system.tables.
459+
/// It must not fail on case of some datalake error.
460+
try
461+
{
462+
iceberg_tables = catalog->getTables();
463+
}
464+
catch (...)
465+
{
466+
tryLogCurrentException(__PRETTY_FUNCTION__);
467+
}
457468

458469
for (const auto & table_name : iceberg_tables)
459470
{
@@ -479,7 +490,18 @@ DatabaseTablesIteratorPtr DatabaseDataLake::getLightweightTablesIterator(
479490
{
480491
Tables tables;
481492
auto catalog = getCatalog();
482-
const auto iceberg_tables = catalog->getTables();
493+
DB::Names iceberg_tables;
494+
495+
/// Do not throw here, because this might be, for example, a query to system.tables.
496+
/// It must not fail on case of some datalake error.
497+
try
498+
{
499+
iceberg_tables = catalog->getTables();
500+
}
501+
catch (...)
502+
{
503+
tryLogCurrentException(__PRETTY_FUNCTION__);
504+
}
483505

484506
for (const auto & table_name : iceberg_tables)
485507
{

0 commit comments

Comments
 (0)