[[arrow::export]]
| 1109 | |
| 1110 | // [[arrow::export]] |
| 1111 | sexp test_arrow_altrep_is_materialized(sexp x) { |
| 1112 | if (!is_arrow_altrep(x)) { |
| 1113 | return Rf_ScalarLogical(NA_LOGICAL); |
| 1114 | } |
| 1115 | |
| 1116 | SEXP class_sym = R_altrep_class_name(x); |
| 1117 | std::string class_name(CHAR(PRINTNAME(class_sym))); |
| 1118 | |
| 1119 | int result = NA_LOGICAL; |
| 1120 | if (class_name == "arrow::array_dbl_vector") { |
| 1121 | result = arrow::r::altrep::AltrepVectorPrimitive<REALSXP>::IsMaterialized(x); |
| 1122 | } else if (class_name == "arrow::array_int_vector") { |
| 1123 | result = arrow::r::altrep::AltrepVectorPrimitive<INTSXP>::IsMaterialized(x); |
| 1124 | } else if (class_name == "arrow::array_string_vector") { |
| 1125 | result = arrow::r::altrep::AltrepVectorString<arrow::StringType>::IsMaterialized(x); |
| 1126 | } else if (class_name == "arrow::array_large_string_vector") { |
| 1127 | result = |
| 1128 | arrow::r::altrep::AltrepVectorString<arrow::LargeStringType>::IsMaterialized(x); |
| 1129 | } else if (class_name == "arrow::array_factor") { |
| 1130 | result = arrow::r::altrep::AltrepFactor::IsMaterialized(x); |
| 1131 | } |
| 1132 | |
| 1133 | return Rf_ScalarLogical(result); |
| 1134 | } |
| 1135 | |
| 1136 | // [[arrow::export]] |
| 1137 | bool test_arrow_altrep_force_materialize(sexp x) { |
no test coverage detected