Skip to content

Commit 9777b29

Browse files
committed
fix initialization of reader
1 parent d326def commit 9777b29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Storages/ObjectStorage/StorageObjectStorageSource.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ void StorageObjectStorageSource::lazyInitialize()
238238

239239
Chunk StorageObjectStorageSource::generate()
240240
{
241+
lazyInitialize();
242+
241243
// Virtual-only mode: no physical columns requested.
242-
if (auto object_info = file_iterator->next(0);
244+
if (auto object_info = reader.getObjectInfo();
243245
read_from_format_info.format_header.columns() == 0 &&
244246
object_info && object_info->metadata.has_value() &&
245247
object_info->metadata->attributes.contains("record_count"))
@@ -304,8 +306,6 @@ Chunk StorageObjectStorageSource::generate()
304306
}
305307

306308

307-
lazyInitialize();
308-
309309
while (true)
310310
{
311311
if (isCancelled() || !reader)

0 commit comments

Comments
 (0)