| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include "config_formats.h" |
| 4 | #include <DataStreams/IBlockInputStream.h> |
| 5 | #include <Processors/Chunk.h> |
| 6 | #include <Processors/Formats/IInputFormat.h> |
| 7 | |
| 8 | #if USE_ORC |
| 9 | |
| 10 | #include "arrow/adapters/orc/adapter.h" |
| 11 | #include "arrow/io/interfaces.h" |
| 12 | |
| 13 | namespace DB |
| 14 | { |
| 15 | class Context; |
| 16 | |
| 17 | class ORCBlockInputFormat: public IInputFormat |
| 18 | { |
| 19 | public: |
| 20 | ORCBlockInputFormat(ReadBuffer & in_, Block header_); |
| 21 | |
| 22 | String getName() const override { return "ORCBlockInputFormat"; } |
| 23 | |
| 24 | void resetParser() override; |
| 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<arrow::adapters::orc::ORCFileReader> file_reader; |
| 34 | std::string file_data; |
| 35 | int row_group_total = 0; |
| 36 | int row_group_current = 0; |
| 37 | }; |
| 38 | |
| 39 | } |
| 40 | #endif |
| 41 |