From 836e35b6c45a38093d6d2cc6594a18471aa73ce3 Mon Sep 17 00:00:00 2001 From: Kruglov Pavel <48961922+Avogar@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:38:10 +0200 Subject: [PATCH 1/2] Fix progress bar for s3 and azure Cluster functions with url without globs --- src/Storages/StorageS3.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Storages/StorageS3.cpp b/src/Storages/StorageS3.cpp index 95f0dc308a6..eb15ee36ced 100644 --- a/src/Storages/StorageS3.cpp +++ b/src/Storages/StorageS3.cpp @@ -207,6 +207,16 @@ private: { auto answer = *buffer_iter; ++buffer_iter; + + /// If url doesn't contain globs, we didn't list s3 bucket and didn't get object info for the key. + /// So we get object info lazily here on 'next()' request. + if (!answer.info) + { + answer.info = S3::getObjectInfo(*client, globbed_uri.bucket, answer.key, globbed_uri.version_id, request_settings); + if (file_progress_callback) + file_progress_callback(FileProgress(0, answer.info->size)); + } + return answer; } From 6dcc75694860073c3a2b4436ab78c65e3ea4abbe Mon Sep 17 00:00:00 2001 From: Kruglov Pavel <48961922+Avogar@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:38:55 +0200 Subject: [PATCH 2/2] Fix for azure --- src/Storages/StorageAzureBlob.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Storages/StorageAzureBlob.cpp b/src/Storages/StorageAzureBlob.cpp index 9ad76657024..a4a686b2691 100644 --- a/src/Storages/StorageAzureBlob.cpp +++ b/src/Storages/StorageAzureBlob.cpp @@ -847,6 +847,8 @@ StorageAzureBlobSource::GlobIterator::GlobIterator( blobs_with_metadata.emplace_back(blob_path_with_globs, object_metadata); if (outer_blobs) outer_blobs->emplace_back(blobs_with_metadata.back()); + if (file_progress_callback) + file_progress_callback(FileProgress(0, object_metadata.size_bytes)); is_finished = true; return; }