From a7486a25cfb37b9157bd583f54a8b2d58002a3c5 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Thu, 18 Apr 2019 20:17:18 +0300 Subject: [PATCH] Fix Cube transform. --- dbms/src/Processors/Transforms/CubeTransform.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dbms/src/Processors/Transforms/CubeTransform.cpp b/dbms/src/Processors/Transforms/CubeTransform.cpp index a91b2d8c3fa..1f2dea41298 100644 --- a/dbms/src/Processors/Transforms/CubeTransform.cpp +++ b/dbms/src/Processors/Transforms/CubeTransform.cpp @@ -39,18 +39,17 @@ Chunk CubeTransform::generate() if (mask) { --mask; - consumed_chunk = gen_chunk; auto columns = current_columns; for (size_t i = 0; i < keys.size(); ++i) - if ((mask & (UInt64(1) << i)) == 0) + if (mask & (UInt64(1) << i)) columns[keys[i]] = current_zero_columns[i]; BlocksList cube_blocks = { getInputPort().getHeader().cloneWithColumns(columns) }; auto cube_block = params->aggregator.mergeBlocks(cube_blocks, false); auto num_rows = cube_block.rows(); - gen_chunk = Chunk(cube_block.getColumns(), num_rows); + consumed_chunk = Chunk(cube_block.getColumns(), num_rows); } finalizeChunk(gen_chunk);