[[arrow::export]]
| 288 | |
| 289 | // [[arrow::export]] |
| 290 | std::shared_ptr<arrow::Table> Table__from_record_batches( |
| 291 | const std::vector<std::shared_ptr<arrow::RecordBatch>>& batches, SEXP schema_sxp) { |
| 292 | bool infer_schema = !Rf_inherits(schema_sxp, "Schema"); |
| 293 | |
| 294 | std::shared_ptr<arrow::Table> tab; |
| 295 | |
| 296 | if (infer_schema) { |
| 297 | tab = ValueOrStop(arrow::Table::FromRecordBatches(std::move(batches))); |
| 298 | } else { |
| 299 | auto schema = cpp11::as_cpp<std::shared_ptr<arrow::Schema>>(schema_sxp); |
| 300 | tab = ValueOrStop(arrow::Table::FromRecordBatches(schema, std::move(batches))); |
| 301 | } |
| 302 | |
| 303 | return tab; |
| 304 | } |
| 305 | |
| 306 | // [[arrow::export]] |
| 307 | std::shared_ptr<arrow::Table> Table__from_schema( |
no test coverage detected