Skip to content

Commit 62e54ca

Browse files
authored
Merge pull request #970 from Altinity/backports/project-antalya/83298-do-not-throw-iceberg
Antalya 25.6.5 Backport of ClickHouse#83298 Do not throw exception on connection with incorrect iceberg database
2 parents 2d8ac3c + 97793b2 commit 62e54ca

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)