From b693652f22b000d62d6c390924dc3c8680905e5e Mon Sep 17 00:00:00 2001 From: MaxTheHuman Date: Tue, 9 Feb 2021 23:41:42 +0300 Subject: [PATCH] revert changes made to cube transform --- src/Processors/Transforms/CubeTransform.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Processors/Transforms/CubeTransform.cpp b/src/Processors/Transforms/CubeTransform.cpp index 13e4963573c..c64f39af5de 100644 --- a/src/Processors/Transforms/CubeTransform.cpp +++ b/src/Processors/Transforms/CubeTransform.cpp @@ -45,7 +45,7 @@ Chunk CubeTransform::generate() consumed_chunks.clear(); auto num_rows = cube_chunk.getNumRows(); - mask = (UInt64(1) << keys.size()); + mask = (UInt64(1) << keys.size()) - 1; current_columns = cube_chunk.getColumns(); current_zero_columns.clear(); @@ -55,11 +55,11 @@ Chunk CubeTransform::generate() current_zero_columns.emplace_back(current_columns[key]->cloneEmpty()->cloneResized(num_rows)); } - // auto gen_chunk = std::move(cube_chunk); + auto gen_chunk = std::move(cube_chunk); - if (mask > 1) + if (mask) { - mask = mask >> 1; + --mask; auto columns = current_columns; auto size = keys.size(); @@ -72,7 +72,6 @@ Chunk CubeTransform::generate() chunks.emplace_back(std::move(columns), current_columns.front()->size()); cube_chunk = merge(std::move(chunks), false); } - auto gen_chunk = std::move(cube_chunk); finalizeChunk(gen_chunk); return gen_chunk;