ClickHouse/src/Processors/Formats/Impl/ParquetBlockInputFormat.h

46 lines
969 B
C++
Raw Normal View History

#pragma once
2019-08-02 16:00:24 +00:00
#include "config_formats.h"
#if USE_PARQUET
2019-08-02 16:00:24 +00:00
#include <Processors/Formats/IInputFormat.h>
#include <Formats/FormatSettings.h>
2020-05-05 12:56:54 +00:00
namespace parquet::arrow { class FileReader; }
namespace arrow { class Buffer; }
namespace DB
{
2021-06-02 08:51:07 +00:00
class ArrowColumnToCHColumn;
2020-05-05 12:56:54 +00:00
class ParquetBlockInputFormat : public IInputFormat
{
public:
ParquetBlockInputFormat(ReadBuffer & in_, Block header_, const FormatSettings & format_settings_);
void resetParser() override;
String getName() const override { return "ParquetBlockInputFormat"; }
protected:
Chunk generate() override;
private:
void prepareReader();
private:
std::unique_ptr<parquet::arrow::FileReader> file_reader;
int row_group_total = 0;
// indices of columns to read from Parquet file
std::vector<int> column_indices;
2021-06-02 08:51:07 +00:00
std::unique_ptr<ArrowColumnToCHColumn> arrow_column_to_ch_column;
int row_group_current = 0;
const FormatSettings format_settings;
};
}
#endif