[[arrow::export]]
| 51 | |
| 52 | // [[arrow::export]] |
| 53 | std::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]] |
| 85 | std::shared_ptr<arrow::ipc::feather::Reader> ipc___feather___Reader__Open( |
no test coverage detected