2014-10-10 15:45:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <DataStreams/IBlockOutputStream.h>
|
|
|
|
#include <Core/NamesAndTypes.h>
|
2014-10-10 15:45:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Throws exception on encountering prohibited column in block
|
|
|
|
class ProhibitColumnsBlockOutputStream : public IBlockOutputStream
|
|
|
|
{
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
ProhibitColumnsBlockOutputStream(const BlockOutputStreamPtr & output, const NamesAndTypesList & columns)
|
|
|
|
: output{output}, columns{columns}
|
|
|
|
{
|
|
|
|
}
|
2014-10-10 15:45:43 +00:00
|
|
|
|
2014-10-13 14:35:40 +00:00
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
void write(const Block & block) override;
|
2014-10-10 15:45:43 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
void flush() override { output->flush(); }
|
2014-10-10 15:45:43 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
void writePrefix() override { output->writePrefix(); }
|
|
|
|
void writeSuffix() override { output->writeSuffix(); }
|
2014-10-10 15:45:43 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
BlockOutputStreamPtr output;
|
|
|
|
NamesAndTypesList columns;
|
2014-10-10 15:45:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|