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

Function Table__from_schema

r/src/table.cpp:307–318  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

305
306// [[arrow::export]]
307std::shared_ptr<arrow::Table> Table__from_schema(
308 const std::shared_ptr<arrow::Schema>& schema) {
309 int64_t num_fields = schema->num_fields();
310
311 std::vector<std::shared_ptr<arrow::ChunkedArray>> columns(num_fields);
312 for (int i = 0; i < num_fields; i++) {
313 auto maybe_column = arrow::ChunkedArray::Make({}, schema->field(i)->type());
314 columns[i] = ValueOrStop(maybe_column);
315 }
316
317 return (arrow::Table::Make(schema, std::move(columns)));
318}
319
320// [[arrow::export]]
321r_vec_size Table__ReferencedBufferSize(const std::shared_ptr<arrow::Table>& table) {

Callers 1

Calls 5

ValueOrStopFunction · 0.85
MakeFunction · 0.50
num_fieldsMethod · 0.45
typeMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected