mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-16 20:53:27 +00:00
40 lines
784 B
C++
40 lines
784 B
C++
#pragma once
|
|
|
|
#include <Poco/SharedPtr.h>
|
|
|
|
#include <DB/Core/Block.h>
|
|
#include <DB/IO/WriteBuffer.h>
|
|
#include <DB/DataStreams/IRowOutputStream.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
using Poco::SharedPtr;
|
|
|
|
|
|
/** Поток для вывода данных в формате VALUES (как в INSERT запросе).
|
|
*/
|
|
class ValuesRowOutputStream : public IRowOutputStream
|
|
{
|
|
public:
|
|
ValuesRowOutputStream(WriteBuffer & ostr_, const Block & sample_);
|
|
|
|
void writeField(const Field & field);
|
|
void writeFieldDelimiter();
|
|
void writeRowStartDelimiter();
|
|
void writeRowEndDelimiter();
|
|
void writeRowBetweenDelimiter();
|
|
|
|
RowOutputStreamPtr clone() { return new ValuesRowOutputStream(ostr, sample); }
|
|
|
|
private:
|
|
WriteBuffer & ostr;
|
|
const Block sample;
|
|
DataTypes data_types;
|
|
size_t field_number;
|
|
};
|
|
|
|
}
|
|
|