romainfrancois commented on pull request #11369:
URL: https://github.com/apache/arrow/pull/11369#issuecomment-972764278


   @nealrichardson I believe this deals with 
https://issues.apache.org/jira/browse/ARROW-14706?filter=12346440, i.e. 
`test_same_Array()` is gone, and `$Same()` is. 
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   #> See arrow_info() for available features
   
   a <- ChunkedArray$create(c(1, 2, 3), c(4, 5, 6))
   b <- ChunkedArray$create(c(7, 8, 9))
   c <- Array$create(c(10, 11, 12))
   d <- Array$create(c(13, 14, 15))
   e <- ChunkedArray$create(c(16, 17), c(18, 19))
   
   x <- ChunkedArray$create(
     # converter to R vectors (with altrep but keeping underlying arrays)
     a$as_vector(), # 2 chunks
     b$as_vector(), # 1 chunk
     c$as_vector(), # 1 array
     
     # passed in directly
     d,
     e
   )
   
   x$chunk(0)$Same(a$chunk(0))
   #> [1] TRUE
   x$chunk(1)$Same(a$chunk(1))
   #> [1] TRUE
   x$chunk(2)$Same(b$chunk(0))
   #> [1] TRUE
   x$chunk(3)$Same(c)
   #> [1] TRUE
   x$chunk(4)$Same(d)
   #> [1] TRUE
   x$chunk(5)$Same(e$chunk(0))
   #> [1] TRUE
   x$chunk(6)$Same(e$chunk(1))
   #> [1] TRUE
   ```
   
   <sup>Created on 2021-11-18 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1.9000)</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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to