MCPcopy Create free account
hub / github.com/apache/arrow / ReadFullFile

Function ReadFullFile

cpp/examples/arrow/parquet_read_write.cc:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include <iostream>
26
27arrow::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
45arrow::Status ReadInBatches(std::string path_to_file) {
46 // #include "arrow/io/api.h"

Callers 1

RunExamplesFunction · 0.85

Calls 5

default_memory_poolFunction · 0.85
OpenFileFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
OKFunction · 0.50
ReadTableMethod · 0.45

Tested by

no test coverage detected