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

Function Schema__from_list

r/src/schema.cpp:31–45  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

29
30// [[arrow::export]]
31std::shared_ptr<arrow::Schema> Schema__from_list(cpp11::list field_list) {
32 R_xlen_t n = field_list.size();
33
34 bool nullable = true;
35 cpp11::strings names(field_list.attr(R_NamesSymbol));
36
37 std::vector<std::shared_ptr<arrow::Field>> fields(n);
38
39 for (R_xlen_t i = 0; i < n; i++) {
40 fields[i] = arrow::field(
41 names[i], cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(field_list[i]),
42 nullable);
43 }
44 return arrow::schema(fields);
45}
46
47// [[arrow::export]]
48std::string Schema__ToString(const std::shared_ptr<arrow::Schema>& s) {

Callers 1

_arrow_Schema__from_listFunction · 0.85

Calls 3

fieldFunction · 0.50
schemaFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected