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

Function ipc___feather___Reader__Read

r/src/feather.cpp:53–82  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

51
52// [[arrow::export]]
53std::shared_ptr<arrow::Table> ipc___feather___Reader__Read(
54 const std::shared_ptr<arrow::ipc::feather::Reader>& reader, cpp11::sexp columns) {
55 bool use_names = columns != R_NilValue;
56 std::vector<std::string> names;
57 if (use_names) {
58 cpp11::strings columns_chr(columns);
59 names.reserve(columns_chr.size());
60 for (const auto& name : columns_chr) {
61 names.push_back(name);
62 }
63 }
64
65 auto result = RunWithCapturedRIfPossible<std::shared_ptr<arrow::Table>>([&]() {
66 std::shared_ptr<arrow::Table> table;
67 arrow::Status read_result;
68 if (use_names) {
69 read_result = reader->Read(names, &table);
70 } else {
71 read_result = reader->Read(&table);
72 }
73
74 if (read_result.ok()) {
75 return arrow::Result<std::shared_ptr<arrow::Table>>(table);
76 } else {
77 return arrow::Result<std::shared_ptr<arrow::Table>>(read_result);
78 }
79 });
80
81 return ValueOrStop(result);
82}
83
84// [[arrow::export]]
85std::shared_ptr<arrow::ipc::feather::Reader> ipc___feather___Reader__Open(

Callers 1

Calls 6

ValueOrStopFunction · 0.85
push_backMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
ReadMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected