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

Function ipc___feather___Reader__Read

r/src/feather.cpp:51–80  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

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