diff --git a/dbms/src/DataStreams/ReverseBlockInputStream.cpp b/dbms/src/DataStreams/ReverseBlockInputStream.cpp index fe2b713ae07..009e3403ff9 100644 --- a/dbms/src/DataStreams/ReverseBlockInputStream.cpp +++ b/dbms/src/DataStreams/ReverseBlockInputStream.cpp @@ -27,19 +27,20 @@ namespace DB return Block(); } - PaddedPODArray permutation; + IColumn::Permutation permutation; - for (size_t i = 0; i < result_block.rows(); ++i) + size_t rows_size = result_block.rows(); + for (size_t i = 0; i < rows_size; ++i) { - permutation.emplace_back(result_block.rows() - 1 - i); + permutation.emplace_back(rows_size - 1 - i); } - for (auto iter = result_block.begin(); iter != result_block.end(); ++iter) + for (auto& block : result_block) { - iter->column = iter->column->permute(permutation, 0); + block.column = block.column->permute(permutation, 0); } return result_block; } -} // namespace DB +} diff --git a/dbms/src/DataStreams/ReverseBlockInputStream.h b/dbms/src/DataStreams/ReverseBlockInputStream.h index 8d00a158a2a..8a040d03457 100644 --- a/dbms/src/DataStreams/ReverseBlockInputStream.h +++ b/dbms/src/DataStreams/ReverseBlockInputStream.h @@ -12,10 +12,10 @@ namespace DB class ReverseBlockInputStream : public IBlockInputStream { public: - ReverseBlockInputStream(const BlockInputStreamPtr& input); + ReverseBlockInputStream( + const BlockInputStreamPtr& input); String getName() const override; - Block getHeader() const override; protected: