-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Milestone
Description
arrow/r/src/array_to_vector.cpp
Lines 975 to 990 in 04641a3
| Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array, | |
| R_xlen_t start, R_xlen_t n, size_t chunk_index) const { | |
| auto p_data = REAL(data) + start; | |
| const auto& decimals_arr = checked_cast<const arrow::Decimal128Array&>(*array); | |
| auto ingest_one = [&](R_xlen_t i) { | |
| p_data[i] = std::stod(decimals_arr.FormatValue(i).c_str()); | |
| return Status::OK(); | |
| }; | |
| auto null_one = [&](R_xlen_t i) { | |
| p_data[i] = NA_REAL; | |
| return Status::OK(); | |
| }; | |
| return IngestSome(array, n, ingest_one, null_one); | |
| } |
"this looks quite inefficient (it roundtrips through a string representation instead of creating a double directly)."
from: #11898 (comment)
Reporter: Jonathan Keane / @jonkeane
Related issues:
- [R] Switch to cpp11 (is fixed by)
PRs and other links:
Note: This issue was originally created as ARROW-15167. Please see the migration documentation for further details.