You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/06/08 16:14:57 UTC

[GitHub] [arrow-nanoarrow] paleolimbot commented on issue #55: [R] Representation of BLOBs

paleolimbot commented on issue #55:
URL: https://github.com/apache/arrow-nanoarrow/issues/55#issuecomment-1582961904

   I forget if this was solved in 0.1 or 0.2, but I believe this is solved now:
   
   ``` r
   library(nanoarrow)
   
   data <- data.frame(
     a = 1:3,
     b = 2.5,
     c = "three",
     stringsAsFactors = FALSE
   )
   data$d <- blob::blob(as.raw(1:10))
   
   array <- as_nanoarrow_array(data)
   array$children$d
   #> <nanoarrow_array binary[3]>
   #>  $ length    : int 3
   #>  $ null_count: int 0
   #>  $ offset    : int 0
   #>  $ buffers   :List of 3
   #>   ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> ``
   #>   ..$ :<nanoarrow_buffer data_offset<int32>[4][16 b]> `0 10 20 30`
   #>   ..$ :<nanoarrow_buffer data<binary>[30 b]> `01 02 03 04 05 06 07 08 09 0a ...`
   #>  $ dictionary: NULL
   #>  $ children  : list()
   
   convert_array(array$children$d)
   #> <blob[3]>
   #> [1] blob[10 B] blob[10 B] blob[10 B]
   ```
   
   <sup>Created on 2023-06-08 with [reprex v2.0.2](https://reprex.tidyverse.org)</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.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org