2019-07-04 18:55:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Processors/Formats/IRowOutputFormat.h>
|
|
|
|
#include <Core/Block.h>
|
|
|
|
|
2021-07-16 10:10:56 +00:00
|
|
|
#include <Core/MySQL/PacketEndpoint.h>
|
|
|
|
#include <Processors/Formats/IOutputFormat.h>
|
|
|
|
|
2019-07-04 18:55:20 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class IColumn;
|
|
|
|
class IDataType;
|
|
|
|
class WriteBuffer;
|
2021-07-16 10:10:56 +00:00
|
|
|
struct FormatSettings;
|
2019-07-04 18:55:20 +00:00
|
|
|
|
|
|
|
/** A stream for outputting data in a binary line-by-line format.
|
|
|
|
*/
|
2021-06-01 12:20:52 +00:00
|
|
|
class MySQLOutputFormat final : public IOutputFormat, WithContext
|
2019-07-04 18:55:20 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-12-25 19:17:41 +00:00
|
|
|
MySQLOutputFormat(WriteBuffer & out_, const Block & header_, const FormatSettings & settings_);
|
2019-07-04 18:55:20 +00:00
|
|
|
|
|
|
|
String getName() const override { return "MySQLOutputFormat"; }
|
|
|
|
|
2021-07-07 15:46:56 +00:00
|
|
|
void setContext(ContextPtr context_);
|
2019-12-25 19:17:41 +00:00
|
|
|
|
2019-08-02 12:41:21 +00:00
|
|
|
void flush() override;
|
2019-08-05 09:35:46 +00:00
|
|
|
|
2021-07-16 10:10:56 +00:00
|
|
|
private:
|
2021-11-02 13:40:41 +00:00
|
|
|
void consume(Chunk) override;
|
2021-11-11 18:09:21 +00:00
|
|
|
void finalizeImpl() override;
|
2021-11-02 13:40:41 +00:00
|
|
|
void writePrefix() override;
|
2019-08-05 09:35:46 +00:00
|
|
|
|
2021-07-16 10:10:56 +00:00
|
|
|
uint32_t client_capabilities = 0;
|
|
|
|
uint8_t * sequence_id = nullptr;
|
|
|
|
uint8_t dummy_sequence_id = 0;
|
2021-07-07 15:46:56 +00:00
|
|
|
MySQLProtocol::PacketEndpointPtr packet_endpoint;
|
2019-12-01 11:21:43 +00:00
|
|
|
DataTypes data_types;
|
2021-03-09 14:46:52 +00:00
|
|
|
Serializations serializations;
|
2019-07-04 18:55:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|