diff --git a/dbms/src/DataStreams/RollupBlockInputStream.cpp b/dbms/src/DataStreams/RollupBlockInputStream.cpp index c0ccd753866..46ed46edae9 100644 --- a/dbms/src/DataStreams/RollupBlockInputStream.cpp +++ b/dbms/src/DataStreams/RollupBlockInputStream.cpp @@ -43,6 +43,11 @@ Block RollupBlockInputStream::getHeader() const Block RollupBlockInputStream::readImpl() { + /** After reading a block from input stream, + * we will subsequently roll it up on next iterations of 'readImpl' + * by zeroing out every column one-by-one and re-merging a block. + */ + if (current_key >= 0) { auto & current = rollup_block.getByPosition(keys[current_key]);