1 | #pragma once |
---|---|
2 | |
3 | #include "config_formats.h" |
4 | #if USE_PARQUET |
5 | # include <Processors/Formats/IOutputFormat.h> |
6 | # include <Formats/FormatSettings.h> |
7 | |
8 | namespace arrow |
9 | { |
10 | class Array; |
11 | class DataType; |
12 | } |
13 | |
14 | namespace parquet |
15 | { |
16 | namespace arrow |
17 | { |
18 | class FileWriter; |
19 | } |
20 | } |
21 | |
22 | namespace DB |
23 | { |
24 | class ParquetBlockOutputFormat : public IOutputFormat |
25 | { |
26 | public: |
27 | ParquetBlockOutputFormat(WriteBuffer & out_, const Block & header_, const FormatSettings & format_settings_); |
28 | |
29 | String getName() const override { return "ParquetBlockOutputFormat"; } |
30 | void consume(Chunk) override; |
31 | void finalize() override; |
32 | |
33 | String getContentType() const override { return "application/octet-stream"; } |
34 | |
35 | private: |
36 | const FormatSettings format_settings; |
37 | |
38 | std::unique_ptr<parquet::arrow::FileWriter> file_writer; |
39 | }; |
40 | |
41 | } |
42 | |
43 | #endif |
44 |