From 2abc4b1ee3a612c7ca976e75f39d9455a88e4307 Mon Sep 17 00:00:00 2001 From: Andrey Zvonov Date: Wed, 22 Oct 2025 20:48:35 +0200 Subject: [PATCH] do not throw if failed reading iceberg metadata --- src/Storages/System/StorageSystemTables.cpp | 41 ++++++++++++++------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/Storages/System/StorageSystemTables.cpp b/src/Storages/System/StorageSystemTables.cpp index 7c28b0558bb5..c3e72231079c 100644 --- a/src/Storages/System/StorageSystemTables.cpp +++ b/src/Storages/System/StorageSystemTables.cpp @@ -607,18 +607,25 @@ class TablesBlockSource : public ISource if (columns_mask[src_index++]) { bool inserted = false; - // Extract from specific DataLake metadata if suitable - if (auto * obj = dynamic_cast(table.get())) + try { - if (auto * dl_meta = obj->getExternalMetadata(context)) + // Extract from specific DataLake metadata if suitable + if (auto * obj = dynamic_cast(table.get())) { - if (auto p = dl_meta->partitionKey(context); p.has_value()) + if (auto * dl_meta = obj->getExternalMetadata(context)) { - res_columns[res_index++]->insert(*p); - inserted = true; + if (auto p = dl_meta->partitionKey(context); p.has_value()) + { + res_columns[res_index++]->insert(*p); + inserted = true; + } } } - + } + catch (const Exception &) + { + /// Failed to get info from Iceberg. It's not critical, just log it. + tryLogCurrentException("StorageSystemTables"); } if (!inserted) @@ -634,18 +641,26 @@ class TablesBlockSource : public ISource { bool inserted = false; - // Extract from specific DataLake metadata if suitable - if (auto * obj = dynamic_cast(table.get())) + try { - if (auto * dl_meta = obj->getExternalMetadata(context)) + // Extract from specific DataLake metadata if suitable + if (auto * obj = dynamic_cast(table.get())) { - if (auto p = dl_meta->sortingKey(context); p.has_value()) + if (auto * dl_meta = obj->getExternalMetadata(context)) { - res_columns[res_index++]->insert(*p); - inserted = true; + if (auto p = dl_meta->sortingKey(context); p.has_value()) + { + res_columns[res_index++]->insert(*p); + inserted = true; + } } } } + catch (const Exception &) + { + /// Failed to get info from Iceberg. It's not critical, just log it. + tryLogCurrentException("StorageSystemTables"); + } if (!inserted) {