Commits


Romain Francois authored and Neal Richardson committed c547f4d4499
ARROW-9291 [R]: Support fixed size binary/list types 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> Closes #7660 from romainfrancois/ARROW-9291/FixedSize Lead-authored-by: Romain Francois <romain@rstudio.com> Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com> Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>