cgiachalis commented on issue #811:
URL:
https://github.com/apache/arrow-nanoarrow/issues/811#issuecomment-3347368063
> Does arrow or pyarrow let an integer be interpreted as a timestamp?
In `arrow`, we can do via `cast` method :
``` r
d <- nanotime::as.nanotime(1)
na <- arrow::arrow_array(bit64::as.integer64(d))$cast(arrow::timestamp("ns"))
class(na)
#> [1] "Array" "ArrowDatum" "ArrowObject" "R6"
nanoarrow::as_nanoarrow_array(na)
#> <nanoarrow_array timestamp('ns', '')[1]>
#> $ length : int 1
#> $ null_count: int 0
#> $ offset : int 0
#> $ buffers :List of 2
#> ..$ :<nanoarrow_buffer validity<bool>[null] ``
#> ..$ :<nanoarrow_buffer data<int64>[1][8 b]> `1`
#> $ dictionary: NULL
#> $ children : list()
```
--
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]