Skip to main content

schema_from_arrow

Function schema_from_arrow 

Source
pub unsafe fn schema_from_arrow(
    connection: duckdb_connection,
    schema: &mut ArrowSchema,
) -> Result<ArrowConvertedSchema, ErrorData>
Expand description

Translates an Arrow schema into DuckDB type descriptors (duckdb_schema_from_arrow).

schema is read, not consumed: the caller still owns it and it is released when its ArrowSchema drops. It is taken by &mut because the C signature is struct ArrowSchema *, even though PopulateArrowTableSchema receives it as const ArrowSchema &.

schema must be the struct schema at the root of a record batch: DuckDB makes one column per child.

§Errors

  • DuckDbErrorType::InvalidInput if schema has already been released, which DuckDB would dereference rather than diagnose.
  • Whatever DuckDB reports for an Arrow type it cannot map — a released child schema, or an unsupported format string.

§Safety

connection must be a live duckdb_connection.