mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
24 lines
509 B
C++
24 lines
509 B
C++
#include <Processors/Transforms/ReverseTransform.h>
|
|
#include <Common/PODArray.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void ReverseTransform::transform(Chunk & chunk)
|
|
{
|
|
IColumn::Permutation permutation;
|
|
|
|
size_t num_rows = chunk.getNumRows();
|
|
for (size_t i = 0; i < num_rows; ++i)
|
|
permutation.emplace_back(num_rows - 1 - i);
|
|
|
|
auto columns = chunk.detachColumns();
|
|
|
|
for (auto & column : columns)
|
|
column = column->permute(permutation, 0);
|
|
|
|
chunk.setColumns(std::move(columns), num_rows);
|
|
}
|
|
|
|
}
|