paleolimbot commented on PR #39250: URL: https://github.com/apache/arrow/pull/39250#issuecomment-1863467919
> There is a lot of downcasting taking place in Arrow R By default, I think you would be hard pressed to find loss of precision happening. The main place that this could happen without explicit user intervention is (1) when converting timestamps to R with subsecond precision (limitation of R, we store timestamps as seconds with double precision) and (2) factors with more then INT_MAX elements in a dictionary (limitation of R, factors are int under the hood). Other downcasting that happens requires intervention from the user (i.e., `Array$create(1.2345, int32())` will truncate `1.234`). I think we can do better in all cases, but we still wouldn't do that checking or erroring at the element level (i.e., where the `static_cast<>()` happens)...we'd want to do something like `if (AnyConversionMayBeLossy(<big long thing>)) return Status::Invalid(...)` before we get to that point. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
