| 25 | #include <iostream> |
| 26 | |
| 27 | arrow::Status ReadFullFile(std::string path_to_file) { |
| 28 | // #include "arrow/io/api.h" |
| 29 | // #include "parquet/arrow/reader.h" |
| 30 | |
| 31 | arrow::MemoryPool* pool = arrow::default_memory_pool(); |
| 32 | std::shared_ptr<arrow::io::RandomAccessFile> input; |
| 33 | ARROW_ASSIGN_OR_RAISE(input, arrow::io::ReadableFile::Open(path_to_file)); |
| 34 | |
| 35 | // Open Parquet file reader |
| 36 | std::unique_ptr<parquet::arrow::FileReader> arrow_reader; |
| 37 | ARROW_ASSIGN_OR_RAISE(arrow_reader, parquet::arrow::OpenFile(input, pool)); |
| 38 | |
| 39 | // Read entire file as a single Arrow table |
| 40 | std::shared_ptr<arrow::Table> table; |
| 41 | ARROW_ASSIGN_OR_RAISE(table, arrow_reader->ReadTable()); |
| 42 | return arrow::Status::OK(); |
| 43 | } |
| 44 | |
| 45 | arrow::Status ReadInBatches(std::string path_to_file) { |
| 46 | // #include "arrow/io/api.h" |
no test coverage detected