2019-02-21 18:36:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-08-02 16:09:52 +00:00
|
|
|
#include "config_formats.h"
|
2019-02-21 18:36:46 +00:00
|
|
|
#if USE_PARQUET
|
|
|
|
# include <Processors/Formats/IOutputFormat.h>
|
|
|
|
# include <Formats/FormatSettings.h>
|
|
|
|
|
|
|
|
namespace arrow
|
|
|
|
{
|
|
|
|
class Array;
|
|
|
|
class DataType;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace parquet
|
|
|
|
{
|
|
|
|
namespace arrow
|
|
|
|
{
|
|
|
|
class FileWriter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
class ParquetBlockOutputFormat : public IOutputFormat
|
|
|
|
{
|
|
|
|
public:
|
2019-08-03 11:02:40 +00:00
|
|
|
ParquetBlockOutputFormat(WriteBuffer & out_, const Block & header_, const FormatSettings & format_settings_);
|
2019-02-21 18:36:46 +00:00
|
|
|
|
|
|
|
String getName() const override { return "ParquetBlockOutputFormat"; }
|
|
|
|
void consume(Chunk) override;
|
|
|
|
void finalize() override;
|
|
|
|
|
|
|
|
String getContentType() const override { return "application/octet-stream"; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
const FormatSettings format_settings;
|
|
|
|
|
|
|
|
std::unique_ptr<parquet::arrow::FileWriter> file_writer;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|