| 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; |
| constauto& 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()); |
| returnStatus::OK(); |
| }; |
| auto null_one = [&](R_xlen_t i) { |
| p_data[i] = NA_REAL; |
| returnStatus::OK(); |
| }; |
| |
| returnIngestSome(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:
PRs and other links:
Note: This issue was originally created as ARROW-15167. Please see the migration documentation for further details.
arrow/r/src/array_to_vector.cpp
Lines 975 to 990 in 04641a3
"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:
PRs and other links:
Note: This issue was originally created as ARROW-15167. Please see the migration documentation for further details.