mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Delete ReduceToPhysicalTransform.
This commit is contained in:
parent
b2b29b7ee8
commit
a7ac6f0b81
@ -1,35 +0,0 @@
|
||||
#include <Processors/Transforms/ReduceToPhysicalTransform.h>
|
||||
#include <Common/PODArray.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
Block ReduceToPhysicalTransform::transformToPhysicalBlock(const Block & header, const ColumnsDescription & columns)
|
||||
{
|
||||
Block out = header.cloneWithoutColumns();
|
||||
|
||||
for (const auto & column : columns.getEphemeral())
|
||||
if (out.has(column.name))
|
||||
out.erase(column.name);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
ReduceToPhysicalTransform::ReduceToPhysicalTransform(const Block & input_header, const ColumnsDescription & columns) :
|
||||
ISimpleTransform(input_header, transformToPhysicalBlock(input_header, columns), false)
|
||||
{
|
||||
/// Find non-physical columns in input_header
|
||||
for (const auto & column : columns.getEphemeral())
|
||||
if (input_header.has(column.name))
|
||||
index.push_back(input_header.getPositionByName(column.name));
|
||||
|
||||
std::sort(index.begin(), index.end(), std::greater());
|
||||
}
|
||||
|
||||
void ReduceToPhysicalTransform::transform(Chunk & chunk)
|
||||
{
|
||||
for (size_t i : index)
|
||||
chunk.erase(i);
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
#pragma once
|
||||
#include <Processors/ISimpleTransform.h>
|
||||
#include <Storages/ColumnsDescription.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
/// Remove non-physical columns.
|
||||
class ReduceToPhysicalTransform : public ISimpleTransform
|
||||
{
|
||||
public:
|
||||
ReduceToPhysicalTransform(const Block & input_header, const ColumnsDescription & columns);
|
||||
String getName() const override { return "ReduceToPhysicalTransform"; }
|
||||
|
||||
static Block transformToPhysicalBlock(const Block & header, const ColumnsDescription & columns);
|
||||
protected:
|
||||
void transform(Chunk & chunk) override;
|
||||
private:
|
||||
std::vector<size_t> index;
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user