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

Function Table__from_record_batches

r/src/table.cpp:290–304  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

288
289// [[arrow::export]]
290std::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]]
307std::shared_ptr<arrow::Table> Table__from_schema(

Callers 1

Calls 1

ValueOrStopFunction · 0.85

Tested by

no test coverage detected