Thalweg · API reference ← Main docs

build_arrow_schema_with_struct_depth

Function build_arrow_schema_with_struct_depth 

Source
pub fn build_arrow_schema_with_struct_depth(
    descriptor_set_bytes: &[u8],
    message_type: &str,
    flatten_depth: u32,
    max_struct_depth: u32,
) -> Result<SchemaRef, ProtoSchemaError>
Expand description

build_arrow_schema with an explicit max_struct_depth, the safety limit on native nested-Struct/Map-value recursion before a sub-message falls back to Utf8-JSON. The default (MAX_STRUCT_DEPTH) suits almost every schema; raise it for an unusually deep message graph, lower it to cap decode cost. Distinct from flatten_depth (flat-column expansion).

§Errors

Returns ProtoSchemaError::Decode if descriptor_set_bytes is not a valid protobuf FileDescriptorSet, or ProtoSchemaError::MessageNotFound if message_type is not present in the set.