MCPcopy Create free account
hub / github.com/apache/arrow / Datum>

Method Datum>

r/src/compute.cpp:78–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77template <>
78arrow::Datum as_cpp<arrow::Datum>(SEXP x) {
79 if (auto array = MaybeUnbox<arrow::Array>("Array", x)) {
80 return array;
81 }
82
83 if (auto chunked_array = MaybeUnbox<arrow::ChunkedArray>("ChunkedArray", x)) {
84 return chunked_array;
85 }
86
87 if (auto batch = MaybeUnbox<arrow::RecordBatch>("RecordBatch", x)) {
88 return batch;
89 }
90
91 if (auto table = MaybeUnbox<arrow::Table>("Table", x)) {
92 return table;
93 }
94
95 if (auto scalar = MaybeUnbox<arrow::Scalar>("Scalar", x)) {
96 return scalar;
97 }
98
99 // This assumes that R objects have already been converted to Arrow objects;
100 // that seems right but should we do the wrapping here too/instead?
101 cpp11::stop("to_datum: Not implemented for type %s", Rf_type2char(TYPEOF(x)));
102}
103} // namespace cpp11
104
105SEXP from_datum(arrow::Datum datum) {

Callers

nothing calls this directly

Calls 1

stopFunction · 0.85

Tested by

no test coverage detected