| Title: | 'Arrow C API' 'nanoarrow' Examples |
|---|---|
| Description: | Programming via the C API of 'Arrow' is powerful, and while documentation exists additional examples should be helpful. Some examples are collected here. |
| Authors: | Dirk Eddelbuettel [aut, cre] |
| Maintainer: | Dirk Eddelbuettel <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.0.1 |
| Built: | 2026-05-31 10:08:16 UTC |
| Source: | https://github.com/eddelbuettel/acane |
Programming via the C API of 'Arrow' is powerful, and while documentation exists additional examples should be helpful. Some examples are collected here.
Index of help topics:
acane-package 'Arrow C API' 'nanoarrow' Examples create_struct_example create_struct_example show_array Display Arrow Structures Array or Schema
Dirk Eddelbuettel <[email protected]>
Dirk Eddelbuettel [aut, cre]
Create a Simple ‘struct’ Arrow Object
create_struct_example()create_struct_example()
A two-column ‘struct’ is created and returned, containing respectively an integer and a floating point column each with one missing value
A external pointer object is returned containing a pointer to the Arrow array with a pointer to the schema tucked away in the ‘tag’ component as is common for nanoarrow objects
s <- create_struct_example() s # pretty-printed in full details thanks to 'nanoarrow' S3 methods as.data.frame(s) # converted thanks to 'nanoarrow' S3 methodss <- create_struct_example() s # pretty-printed in full details thanks to 'nanoarrow' S3 methods as.data.frame(s) # converted thanks to 'nanoarrow' S3 methods
Helper functions showing elements of ‘Arrow Array’ or ‘Arrow Schema’ objects provided via an external pointer
show_array(sxparr) show_schema(sxparr) array_xptr_set_schema(array_xptr, schema_xptr) array_xptr_get_schema(array_xptr)show_array(sxparr) show_schema(sxparr) array_xptr_set_schema(array_xptr, schema_xptr) array_xptr_get_schema(array_xptr)
sxparr |
An external pointer to an ‘Arrow Array’ also containing a pointer to the corresponding ‘Arrow Schema’ in its ‘tag’ slot |
array_xptr |
A external pointer to an Arrow array data structure |
schema_xptr |
A external pointer to an Arrow schema data structure |
Nothing is returned, the functions are invoked for the side effect of printing