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