paleolimbot opened a new pull request, #47:
URL: https://github.com/apache/arrow-nanoarrow/pull/47

   Allows inspecting schemas (next: arrays and array streams)
   
   ``` r
   library(nanoarrow)
   schema <- infer_nanoarrow_schema(data.frame(a = 1L, b = "two", c = 
factor("three")))
   
   # list-like interface for accessing values
   schema$format
   #> [1] "+s"
   schema$children$b$format
   #> [1] "u"
   schema$children[[3]]
   #> <nanoarrow_schema[c]>
   #> List of 6
   #>  $ format    : chr "c"
   #>  $ name      : chr "c"
   #>  $ metadata  : list()
   #>  $ flags     : int 2
   #>  $ children  : NULL
   #>  $ dictionary:List of 6
   #>   ..$ format    : chr "u"
   #>   ..$ name      : chr ""
   #>   ..$ metadata  : list()
   #>   ..$ flags     : int 2
   #>   ..$ children  : NULL
   #>   ..$ dictionary: NULL
   
   # print/str/format methods (right now just a lazy dump of the list version)
   schema
   #> <nanoarrow_schema[+s]>
   #> List of 6
   #>  $ format    : chr "+s"
   #>  $ name      : chr ""
   #>  $ metadata  : list()
   #>  $ flags     : int 2
   #>  $ children  :List of 3
   #>   ..$ a:List of 6
   #>   .. ..$ format    : chr "i"
   #>   .. ..$ name      : chr "a"
   #>   .. ..$ metadata  : list()
   #>   .. ..$ flags     : int 2
   #>   .. ..$ children  : NULL
   #>   .. ..$ dictionary: NULL
   #>   ..$ b:List of 6
   #>   .. ..$ format    : chr "u"
   #>   .. ..$ name      : chr "b"
   #>   .. ..$ metadata  : list()
   #>   .. ..$ flags     : int 2
   #>   .. ..$ children  : NULL
   #>   .. ..$ dictionary: NULL
   #>   ..$ c:List of 6
   #>   .. ..$ format    : chr "c"
   #>   .. ..$ name      : chr "c"
   #>   .. ..$ metadata  : list()
   #>   .. ..$ flags     : int 2
   #>   .. ..$ children  : NULL
   #>   .. ..$ dictionary:List of 6
   #>   .. .. ..$ format    : chr "u"
   #>   .. .. ..$ name      : chr ""
   #>   .. .. ..$ metadata  : list()
   #>   .. .. ..$ flags     : int 2
   #>   .. .. ..$ children  : NULL
   #>   .. .. ..$ dictionary: NULL
   #>  $ dictionary: NULL
   ```
   
   <sup>Created on 2022-09-12 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</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