Package 'acane'

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

Help Index


'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.

Package Content

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

Maintainer

Dirk Eddelbuettel <[email protected]>

Author(s)

Dirk Eddelbuettel [aut, cre]


create_struct_example

Description

Create a Simple ‘struct’ Arrow Object

Usage

create_struct_example()

Details

A two-column ‘struct’ is created and returned, containing respectively an integer and a floating point column each with one missing value

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

Examples

s <- create_struct_example()
s                 # pretty-printed in full details thanks to 'nanoarrow' S3 methods
as.data.frame(s)  # converted thanks to 'nanoarrow' S3 methods

Display Arrow Structures Array or Schema

Description

Helper functions showing elements of ‘Arrow Array’ or ‘Arrow Schema’ objects provided via an external pointer

Usage

show_array(sxparr)

show_schema(sxparr)

array_xptr_set_schema(array_xptr, schema_xptr)

array_xptr_get_schema(array_xptr)

Arguments

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

Value

Nothing is returned, the functions are invoked for the side effect of printing