2019-08-21 14:19:47 +00:00
|
|
|
#pragma once
|
|
|
|
#include "config_formats.h"
|
2020-05-03 23:19:56 +00:00
|
|
|
#if USE_ORC
|
|
|
|
|
2019-08-21 14:19:47 +00:00
|
|
|
#include <Processors/Formats/IInputFormat.h>
|
2021-05-25 12:01:28 +00:00
|
|
|
#include <Processors/Formats/Impl/ArrowColumnToCHColumn.h>
|
2019-08-21 14:19:47 +00:00
|
|
|
|
2020-05-03 23:19:56 +00:00
|
|
|
namespace arrow::adapters::orc { class ORCFileReader; }
|
2019-08-21 14:19:47 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-05 12:56:54 +00:00
|
|
|
class ORCBlockInputFormat : public IInputFormat
|
2019-08-21 14:19:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-12-25 19:17:41 +00:00
|
|
|
ORCBlockInputFormat(ReadBuffer & in_, Block header_);
|
2019-08-21 14:19:47 +00:00
|
|
|
|
|
|
|
String getName() const override { return "ORCBlockInputFormat"; }
|
|
|
|
|
2019-11-26 23:46:19 +00:00
|
|
|
void resetParser() override;
|
|
|
|
|
2019-08-21 14:19:47 +00:00
|
|
|
protected:
|
|
|
|
Chunk generate() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
// TODO: check that this class implements every part of its parent
|
|
|
|
|
|
|
|
std::unique_ptr<arrow::adapters::orc::ORCFileReader> file_reader;
|
2021-04-15 04:01:15 +00:00
|
|
|
|
2021-05-25 12:01:28 +00:00
|
|
|
ArrowColumnToCHColumn arrow_column_to_ch_column;
|
|
|
|
|
2021-04-15 04:01:15 +00:00
|
|
|
int stripe_total = 0;
|
|
|
|
|
|
|
|
int stripe_current = 0;
|
|
|
|
|
|
|
|
// indices of columns to read from ORC file
|
|
|
|
std::vector<int> include_indices;
|
|
|
|
|
|
|
|
void prepareReader();
|
2019-08-21 14:19:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|