1 | #pragma once |
---|---|
2 | |
3 | #include "config_formats.h" |
4 | #if USE_PARQUET |
5 | |
6 | #include <Processors/Formats/IInputFormat.h> |
7 | |
8 | |
9 | namespace parquet { namespace arrow { class FileReader; } } |
10 | namespace arrow { class Buffer; } |
11 | |
12 | namespace DB |
13 | { |
14 | class Context; |
15 | |
16 | class ParquetBlockInputFormat: public IInputFormat |
17 | { |
18 | public: |
19 | ParquetBlockInputFormat(ReadBuffer & in_, Block header_); |
20 | |
21 | void resetParser() override; |
22 | |
23 | |
24 | String getName() const override { return "ParquetBlockInputFormat"; } |
25 | |
26 | protected: |
27 | Chunk generate() override; |
28 | |
29 | private: |
30 | |
31 | // TODO: check that this class implements every part of its parent |
32 | |
33 | std::unique_ptr<parquet::arrow::FileReader> file_reader; |
34 | std::string file_data; |
35 | std::unique_ptr<arrow::Buffer> buffer; |
36 | int row_group_total = 0; |
37 | int row_group_current = 0; |
38 | }; |
39 | |
40 | } |
41 | |
42 | #endif |
43 |