mirror of
https://github.com/cldellow/sqlite-parquet-vtable.git
synced 2025-09-12 22:29:58 +00:00
Very rough first cut
supports int32, double, strings.
This commit is contained in:
52
parquet/parquet_cursor.h
Normal file
52
parquet/parquet_cursor.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#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;
|
||||
|
||||
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;
|
||||
|
||||
void nextRowGroup();
|
||||
|
||||
public:
|
||||
ParquetCursor(ParquetTable* table);
|
||||
int getRowId();
|
||||
void next();
|
||||
bool eof();
|
||||
|
||||
void ensureColumn(int col);
|
||||
bool isNull(int col);
|
||||
int getInt(int col);
|
||||
double getDouble(int col);
|
||||
parquet::ByteArray* getByteArray(int col);
|
||||
parquet::Type::type getPhysicalType(int col);
|
||||
/*
|
||||
sqlite3_result_double()
|
||||
sqlite3_result_int()
|
||||
sqlite3_result_int64()
|
||||
sqlite3_result_null()
|
||||
sqlite3_result_text()
|
||||
*/
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user