34973 {
34974 D_ASSERT(out_schema);
34975 D_ASSERT(types.size() == names.size());
34976 const idx_t column_count = types.size();
34977
34978 auto root_holder = make_uniq<DuckDBArrowSchemaHolder>();
34979
34980
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
34990 out_schema->
format =
"+s";
34991 out_schema->flags = 0;
34992 out_schema->metadata = nullptr;
34993 out_schema->name = "duckdb_query_result";
34994 out_schema->dictionary = nullptr;
34995
34996
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];
35001 SetArrowFormat(*root_holder, child, types[col_idx], options, *options.client_context);
35002 }
35003
35004
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