Copilot commented on code in PR #50374:
URL: https://github.com/apache/arrow/pull/50374#discussion_r3544714217


##########
r/vignettes/data_types.Rmd:
##########
@@ -97,9 +97,10 @@ If the value in R does not fall within the permissible range 
for the correspondi
 chunked_array(c(10L, 3L, 200L), type = int8())
 ```
 
-When translating from Arrow to R, integer types alway translate to R integers 
unless one of the following exceptions applies:
+When translating from Arrow to R, integer types always translate to R integers 
unless one of the following exceptions applies:
 
-- If the value of an Arrow uint32 or uint64 falls outside the range allowed 
for R integers, the result will be a numeric vector in R 
+- Arrow uint64 types are always converted to numeric (double) vectors in R

Review Comment:
   The new mapping “uint64 → R numeric (double)” is correct for type 
unification, but it can still silently lose integer precision once values 
exceed 2^53 (because R numeric is IEEE-754 double). It would help to mention 
this explicitly here so users don’t assume all uint64 values round-trip exactly.



##########
r/R/type.R:
##########
@@ -356,13 +356,13 @@ NestedType <- R6Class("NestedType", inherit = DataType)
 #' `date32()` creates a datetime type with a "day" unit, like the R `Date`
 #' class. `date64()` has a "ms" unit.
 #'
-#' `uint32` (32 bit unsigned integer), `uint64` (64 bit unsigned integer), and
-#' `int64` (64-bit signed integer) types may contain values that exceed the
-#' range of R's `integer` type (32-bit signed integer). When these arrow 
objects
-#' are translated to R objects, `uint32` and `uint64` are converted to `double`
-#' ("numeric") and `int64` is converted to `bit64::integer64`. For `int64`
-#' types, this conversion can be disabled (so that `int64` always yields a
-#' `bit64::integer64` object) by setting `options(arrow.int64_downcast =
+#' `uint64` (64 bit unsigned integer) is always converted to `double`
+#' ("numeric") in R. `uint32` (32 bit unsigned integer) and `int64` (64-bit
+#' signed integer) types may contain values that exceed the range of R's
+#' `integer` type (32-bit signed integer). When they do, `uint32` is converted
+#' to `double` ("numeric") and `int64` is converted to `bit64::integer64`. For

Review Comment:
   This documentation states that `uint64` is always converted to `double`, but 
it doesn’t mention that doubles can’t exactly represent all 64-bit integers 
(precision loss above 2^53). Adding that clarification would set expectations 
for users relying on large identifiers.



-- 
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]

Reply via email to