diff --git a/src/Storages/StorageS3.cpp b/src/Storages/StorageS3.cpp index dfb1aa9ddf0..e477e522d65 100644 --- a/src/Storages/StorageS3.cpp +++ b/src/Storages/StorageS3.cpp @@ -552,7 +552,7 @@ StorageS3Source::StorageS3Source( , create_reader_scheduler(threadPoolCallbackRunner(create_reader_pool, "CreateS3Reader")) { reader = createReader(); - if (reader || + if (reader || (reader.getReadMode() == StorageS3Source::ReaderHolder::ONLY_VIRTUAL_COLUMNS && !reader.isFinishedForOnlyVirtualColumns())) reader_future = createReaderAsync(); @@ -756,7 +756,7 @@ Chunk StorageS3Source::generate() assert(reader_future.valid()); reader = reader_future.get(); - if ((!reader && + if ((!reader && reader.getReadMode() == ReaderHolder::ALL) || (reader.getReadMode() == ReaderHolder::ONLY_VIRTUAL_COLUMNS && reader.isFinishedForOnlyVirtualColumns()))