Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ArrowConverter Struct Reference

Static Public Member Functions

static DUCKDB_API void ToArrowSchema (ArrowSchema *out_schema, const vector< LogicalType > &types, const vector< string > &names, ClientProperties &options)
 
static DUCKDB_API void ToArrowArray (DataChunk &input, ArrowArray *out_array, ClientProperties options, const unordered_map< idx_t, const shared_ptr< ArrowTypeExtensionData > > &extension_type_cast)
 

Member Function Documentation

◆ ToArrowSchema()

void duckdb::ArrowConverter::ToArrowSchema ( ArrowSchema out_schema,
const vector< LogicalType > &  types,
const vector< string > &  names,
ClientProperties options 
)
static
34973 {
34974 D_ASSERT(out_schema);
34975 D_ASSERT(types.size() == names.size());
34976 const idx_t column_count = types.size();
34977 // Allocate as unique_ptr first to clean-up properly on error
34978 auto root_holder = make_uniq<DuckDBArrowSchemaHolder>();
34979
34980 // Allocate the children
34981 root_holder->children.resize(column_count);
34982 root_holder->children_ptrs.resize(column_count, nullptr);
34983 for (size_t i = 0; i < column_count; ++i) {
34984 root_holder->children_ptrs[i] = &root_holder->children[i];
34985 }
34986 out_schema->children = root_holder->children_ptrs.data();
34987 out_schema->n_children = NumericCast<int64_t>(column_count);
34988
34989 // Store the schema
34990 out_schema->format = "+s"; // struct apparently
34991 out_schema->flags = 0;
34992 out_schema->metadata = nullptr;
34993 out_schema->name = "duckdb_query_result";
34994 out_schema->dictionary = nullptr;
34995
34996 // Configure all child schemas
34997 for (idx_t col_idx = 0; col_idx < column_count; col_idx++) {
34998 root_holder->owned_column_names.push_back(AddName(names[col_idx]));
34999 auto &child = root_holder->children[col_idx];
35000 InitializeChild(child, *root_holder, names[col_idx]);
35001 SetArrowFormat(*root_holder, child, types[col_idx], options, *options.client_context);
35002 }
35003
35004 // Release ownership to caller
35005 out_schema->private_data = root_holder.release();
35006 out_schema->release = ReleaseDuckDBArrowSchema;
35007}
void InitializeChild(ArrowSchema &child, DuckDBArrowSchemaHolder &root_holder, const string &name="")
Definition duckdb.cpp:34603
void * private_data
Opaque producer-specific data.
Definition duckdb.hpp:11276
const char * format
Array type description.
Definition duckdb.hpp:11265
void(* release)(struct ArrowSchema *)
Release callback.
Definition duckdb.hpp:11274

◆ ToArrowArray()

void duckdb::ArrowConverter::ToArrowArray ( DataChunk input,
ArrowArray out_array,
ClientProperties  options,
const unordered_map< idx_t, const shared_ptr< ArrowTypeExtensionData > > &  extension_type_cast 
)
static
34577 {
34578 ArrowAppender appender(input.GetTypes(), input.size(), std::move(options), extension_type_cast);
34579 appender.Append(input, 0, input.size(), input.size());
34580 *out_array = appender.Finalize();
34581}

The documentation for this struct was generated from the following files: