2019-08-21 14:19:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "config_formats.h"
|
|
|
|
#include <DataStreams/IBlockInputStream.h>
|
|
|
|
#include <Processors/Chunk.h>
|
|
|
|
#include <Processors/Formats/IInputFormat.h>
|
|
|
|
|
|
|
|
#if USE_ORC
|
|
|
|
|
|
|
|
#include "arrow/adapters/orc/adapter.h"
|
|
|
|
#include "arrow/io/interfaces.h"
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
class ORCBlockInputFormat: public IInputFormat
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ORCBlockInputFormat(ReadBuffer & in_, Block header_, const Context & context_);
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
const Context & context;
|
|
|
|
|
|
|
|
std::unique_ptr<arrow::adapters::orc::ORCFileReader> file_reader;
|
|
|
|
std::string file_data;
|
|
|
|
int row_group_total = 0;
|
|
|
|
int row_group_current = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|