romainfrancois opened a new pull request #7660:
URL: https://github.com/apache/arrow/pull/7660
some progress here:
``` r
library(arrow, warn.conflicts = FALSE)
a <- Array$create(vctrs::list_of(as.raw(1:4), as.raw(1:4)), type =
fixed_size_binary(4L))
a
#> Array
#> <fixed_size_binary[4]>
#> [
#> 01020304,
#> 01020304
#> ]
v <- a$as_vector()
v
#> <fixed_size_binary<4>[2]>
#> [[1]]
#> [1] 01 02 03 04
#>
#> [[2]]
#> [1] 01 02 03 04
str(v)
#> fixed_size_binary<4> [1:2]
#> $ : raw [1:4] 01 02 03 04
#> $ : raw [1:4] 01 02 03 04
# we can skip the type= we have an R object that inherits from vctrs_list_of,
# with class arrow_fixed_size_binary and a byte_width attribute
raws <- vctrs::new_list_of(
list(as.raw(1:4), as.raw(1:4)),
ptype = raw(),
byte_width = 4L,
class = "arrow_fixed_size_binary"
)
a <- Array$create(raws)
a
#> Array
#> <fixed_size_binary[4]>
#> [
#> 01020304,
#> 01020304
#> ]
v <- a$as_vector()
v
#> <fixed_size_binary<4>[2]>
#> [[1]]
#> [1] 01 02 03 04
#>
#> [[2]]
#> [1] 01 02 03 04
str(v)
#> fixed_size_binary<4> [1:2]
#> $ : raw [1:4] 01 02 03 04
#> $ : raw [1:4] 01 02 03 04
```
<sup>Created on 2020-07-07 by the [reprex
package](https://reprex.tidyverse.org) (v0.3.0.9001)</sup>
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]