[[arrow::export]]
| 32 | |
| 33 | // [[arrow::export]] |
| 34 | std::shared_ptr<arrow::RecordBatch> RecordBatch__cast( |
| 35 | const std::shared_ptr<arrow::RecordBatch>& batch, |
| 36 | const std::shared_ptr<arrow::Schema>& schema, cpp11::list options) { |
| 37 | auto opts = make_cast_options(options); |
| 38 | auto nc = batch->num_columns(); |
| 39 | |
| 40 | arrow::ArrayVector columns(nc); |
| 41 | for (int i = 0; i < nc; i++) { |
| 42 | columns[i] = ValueOrStop( |
| 43 | arrow::compute::Cast(*batch->column(i), schema->field(i)->type(), *opts)); |
| 44 | } |
| 45 | |
| 46 | return arrow::RecordBatch::Make(schema, batch->num_rows(), std::move(columns)); |
| 47 | } |
| 48 | |
| 49 | // [[arrow::export]] |
| 50 | std::shared_ptr<arrow::Table> Table__cast(const std::shared_ptr<arrow::Table>& table, |
no test coverage detected