From ffb45354bd8e02f8172ae67d12fcacc5bc70f5a1 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 19 Aug 2024 05:23:32 +0200 Subject: [PATCH] Fix error --- src/Storages/MergeTree/MergeTreeIndexGranularityInfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Storages/MergeTree/MergeTreeIndexGranularityInfo.cpp b/src/Storages/MergeTree/MergeTreeIndexGranularityInfo.cpp index 27afa7b9a86..537db67b31a 100644 --- a/src/Storages/MergeTree/MergeTreeIndexGranularityInfo.cpp +++ b/src/Storages/MergeTree/MergeTreeIndexGranularityInfo.cpp @@ -94,9 +94,10 @@ std::string MarkType::describe() const std::optional MergeTreeIndexGranularityInfo::getMarksTypeFromFilesystem(const IDataPartStorage & data_part_storage) { - for (auto it = data_part_storage.iterate(); it->isValid(); it->next()) - if (std::string ext = fs::path(it->name()).extension(); MarkType::isMarkFileExtension(ext)) - return MarkType(ext); + if (data_part_storage.exists()) + for (auto it = data_part_storage.iterate(); it->isValid(); it->next()) + if (std::string ext = fs::path(it->name()).extension(); MarkType::isMarkFileExtension(ext)) + return MarkType(ext); return {}; }