Merge pull request #55666 from ClickHouse/Avogar-patch-1

Fix progress bar for s3 and azure Cluster functions with url without globs
This commit is contained in:
Kruglov Pavel 2023-10-16 18:25:00 +02:00 committed by GitHub
commit cbdb62d389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -847,6 +847,8 @@ StorageAzureBlobSource::GlobIterator::GlobIterator(
blobs_with_metadata.emplace_back(blob_path_with_globs, object_metadata); blobs_with_metadata.emplace_back(blob_path_with_globs, object_metadata);
if (outer_blobs) if (outer_blobs)
outer_blobs->emplace_back(blobs_with_metadata.back()); outer_blobs->emplace_back(blobs_with_metadata.back());
if (file_progress_callback)
file_progress_callback(FileProgress(0, object_metadata.size_bytes));
is_finished = true; is_finished = true;
return; return;
} }

View File

@ -207,6 +207,16 @@ private:
{ {
auto answer = *buffer_iter; auto answer = *buffer_iter;
++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; return answer;
} }