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

Function vec_to_arrow__reuse_memory

r/src/r_to_arrow.cpp:1276–1290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274}
1275
1276std::shared_ptr<arrow::Array> vec_to_arrow__reuse_memory(SEXP x) {
1277 auto type = TYPEOF(x);
1278
1279 if (type == INTSXP) {
1280 return MakeSimpleArray<INTSXP, cpp11::integers, Int32Type>(x);
1281 } else if (type == REALSXP && Rf_inherits(x, "integer64")) {
1282 return MakeSimpleArray<REALSXP, cpp11::doubles, Int64Type>(x);
1283 } else if (type == REALSXP) {
1284 return MakeSimpleArray<REALSXP, cpp11::doubles, DoubleType>(x);
1285 } else if (type == RAWSXP) {
1286 return MakeSimpleArray<RAWSXP, cpp11::raws, UInt8Type>(x);
1287 }
1288
1289 cpp11::stop("Unreachable: you might need to fix can_reuse_memory()");
1290}
1291
1292std::shared_ptr<arrow::ChunkedArray> vec_to_arrow_ChunkedArray(
1293 SEXP x, const std::shared_ptr<arrow::DataType>& type, bool type_inferred) {

Callers 1

Calls 1

stopFunction · 0.85

Tested by

no test coverage detected