| 1281 | } |
| 1282 | |
| 1283 | std::shared_ptr<arrow::Array> vec_to_arrow__reuse_memory(SEXP x) { |
| 1284 | auto type = TYPEOF(x); |
| 1285 | |
| 1286 | if (type == INTSXP) { |
| 1287 | return MakeSimpleArray<INTSXP, cpp11::integers, Int32Type>(x); |
| 1288 | } else if (type == REALSXP && Rf_inherits(x, "integer64")) { |
| 1289 | return MakeSimpleArray<REALSXP, cpp11::doubles, Int64Type>(x); |
| 1290 | } else if (type == REALSXP) { |
| 1291 | return MakeSimpleArray<REALSXP, cpp11::doubles, DoubleType>(x); |
| 1292 | } else if (type == RAWSXP) { |
| 1293 | return MakeSimpleArray<RAWSXP, cpp11::raws, UInt8Type>(x); |
| 1294 | } |
| 1295 | |
| 1296 | cpp11::stop("Unreachable: you might need to fix can_reuse_memory()"); |
| 1297 | } |
| 1298 | |
| 1299 | std::shared_ptr<arrow::ChunkedArray> vec_to_arrow_ChunkedArray( |
| 1300 | SEXP x, const std::shared_ptr<arrow::DataType>& type, bool type_inferred) { |
no test coverage detected