From a41cadb15051abe4a28494b2f58fafd556026d04 Mon Sep 17 00:00:00 2001 From: Yarik Briukhovetskyi <114298166+yariks5s@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:37:38 +0100 Subject: [PATCH 1/2] init --- src/Storages/ObjectStorage/StorageObjectStorage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Storages/ObjectStorage/StorageObjectStorage.cpp b/src/Storages/ObjectStorage/StorageObjectStorage.cpp index fd2fe0400bb..a246e714db2 100644 --- a/src/Storages/ObjectStorage/StorageObjectStorage.cpp +++ b/src/Storages/ObjectStorage/StorageObjectStorage.cpp @@ -47,6 +47,7 @@ String StorageObjectStorage::getPathSample(StorageInMemoryMetadata metadata, Con auto query_settings = configuration->getQuerySettings(context); /// We don't want to throw an exception if there are no files with specified path. query_settings.throw_on_zero_files_match = false; + query_settings.ignore_non_existent_file = true; bool local_distributed_processing = distributed_processing; if (context->getSettingsRef()[Setting::use_hive_partitioning]) @@ -64,6 +65,9 @@ String StorageObjectStorage::getPathSample(StorageInMemoryMetadata metadata, Con {} // file_progress_callback ); + if (dynamic_cast(file_iterator.get())) + return ""; + if (auto file = file_iterator->next(0)) return file->getPath(); return ""; From 9c22f3d89fb7d72de8e5545d716b6a6852ae53ea Mon Sep 17 00:00:00 2001 From: Yarik Briukhovetskyi <114298166+yariks5s@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:54:59 +0100 Subject: [PATCH 2/2] Review update. --- src/Storages/ObjectStorage/StorageObjectStorage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Storages/ObjectStorage/StorageObjectStorage.cpp b/src/Storages/ObjectStorage/StorageObjectStorage.cpp index a246e714db2..5e9ce8dce28 100644 --- a/src/Storages/ObjectStorage/StorageObjectStorage.cpp +++ b/src/Storages/ObjectStorage/StorageObjectStorage.cpp @@ -65,8 +65,8 @@ String StorageObjectStorage::getPathSample(StorageInMemoryMetadata metadata, Con {} // file_progress_callback ); - if (dynamic_cast(file_iterator.get())) - return ""; + if (!configuration->isArchive() && !configuration->isPathWithGlobs() && !local_distributed_processing) + return configuration->getPath(); if (auto file = file_iterator->next(0)) return file->getPath();