Skip to main content

requires_nested_struct_cast

Function requires_nested_struct_cast 

Source
pub fn requires_nested_struct_cast(
    source_type: &DataType,
    target_type: &DataType,
) -> bool
Expand description

Returns true if casting from source_type to target_type requires name-based nested struct casting logic, rather than Arrow’s standard cast.

This is the case when both types are struct types, or both are the same container type (List, LargeList, ListView, LargeListView, Dictionary) wrapping types that recursively contain structs.

Use this predicate at both planning time (to decide whether to apply struct compatibility validation) and execution time (to decide whether to route through cast_column instead of Arrow’s generic cast).