MCPcopy Create free account
hub / github.com/apache/arrow-rs / _fields

Method _fields

arrow-schema/src/field.rs:695–709  ·  view source on GitHub ↗
(dt: &DataType)

Source from the content-addressed store, hash-verified

693 }
694
695 fn _fields(dt: &DataType) -> Vec<&Field> {
696 match dt {
697 DataType::Struct(fields) => fields.iter().flat_map(|f| f.fields()).collect(),
698 DataType::Union(fields, _) => fields.iter().flat_map(|(_, f)| f.fields()).collect(),
699 DataType::List(field)
700 | DataType::LargeList(field)
701 | DataType::ListView(field)
702 | DataType::LargeListView(field)
703 | DataType::FixedSizeList(field, _)
704 | DataType::Map(field, _) => field.fields(),
705 DataType::Dictionary(_, value_field) => Field::_fields(value_field.as_ref()),
706 DataType::RunEndEncoded(_, field) => field.fields(),
707 _ => vec![],
708 }
709 }
710
711 /// Returns a vector containing all (potentially nested) `Field` instances selected by the
712 /// dictionary ID they use

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
iterMethod · 0.45
fieldsMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected