diff --git a/src/Processors/Formats/IRowInputFormat.cpp b/src/Processors/Formats/IRowInputFormat.cpp index 91ed023277e..626c7b6835f 100644 --- a/src/Processors/Formats/IRowInputFormat.cpp +++ b/src/Processors/Formats/IRowInputFormat.cpp @@ -119,6 +119,8 @@ Chunk IRowInputFormat::read() auto chunk_offset = [&]() -> size_t { + if (total_rows == 0) + return getDataOffsetMaybeCompressed(getReadBuffer()); return getDataOffsetMaybeCompressed(getReadBuffer()) + getReadBuffer().offset(); };