sqlite-parquet-vtable/parquet/parquet_cursor.h

50 lines
1.2 KiB
C
Raw Normal View History

#ifndef PARQUET_CURSOR_H
#define PARQUET_CURSOR_H
#include "parquet_table.h"
#include "parquet/api/reader.h"
class ParquetCursor {
ParquetTable* table;
std::unique_ptr<parquet::ParquetFileReader> reader;
std::unique_ptr<parquet::RowGroupMetaData> rowGroupMetadata;
std::shared_ptr<parquet::RowGroupReader> rowGroup;
std::vector<std::shared_ptr<parquet::Scanner>> scanners;
std::vector<parquet::Type::type> types;
2018-03-04 22:20:28 +00:00
std::vector<parquet::LogicalType::type> logicalTypes;
std::vector<int> colRows;
std::vector<bool> colNulls;
std::vector<uintptr_t> colIntValues;
std::vector<double> colDoubleValues;
std::vector<parquet::ByteArray> colByteArrayValues;
int rowId;
int rowGroupId;
int numRows;
int numRowGroups;
int rowsLeftInRowGroup;
2018-03-04 22:49:19 +00:00
bool nextRowGroup();
public:
ParquetCursor(ParquetTable* table);
int getRowId();
void next();
bool eof();
void ensureColumn(int col);
bool isNull(int col);
2018-03-04 01:00:50 +00:00
parquet::Type::type getPhysicalType(int col);
2018-03-04 22:20:28 +00:00
parquet::LogicalType::type getLogicalType(int col);
2018-03-04 01:00:50 +00:00
int getInt32(int col);
long getInt64(int col);
double getDouble(int col);
parquet::ByteArray* getByteArray(int col);
};
#endif