pub fn check_contains(&self, sub_type: &ParquetType) -> bool {
        let basic_match = self.get_field_info() == sub_type.get_field_info();

        match (self, sub_type) {
            (
                Self::PrimitiveType(PrimitiveType { physical_type, .. }),
                Self::PrimitiveType(PrimitiveType {
                    physical_type: other_physical_type,
                    ..
                }),
            ) => basic_match && physical_type == other_physical_type,
            (
                Self::GroupType { fields, .. },
                Self::GroupType {
                    fields: other_fields,
                    ..
                },
            ) => {
                // build hashmap of name -> Type
                let mut field_map = HashMap::new();
                for field in fields {
                    field_map.insert(field.name(), field);
                }

                for field in other_fields {
                    if !field_map
                        .get(field.name())
                        .map(|tpe| tpe.check_contains(field))
                        .unwrap_or(false)
                    {
                        return false;
                    }
                }
                true
            }
            _ => false,
        }
    }
/// Checks if `sub_type` schema is part of current schema.
/// This method can be used to check if projected columns are part of the root schema.
Checks if `sub_type` schema is part of current schema.
This method can be used to check if projected columns are part of the root schema.
Checks if ` sub_type ` schema is part of current schema . This method can be used to check if projected columns are part of the root schema .
pub fn check_contains(&self, sub_type: &ParquetType) -> bool {
        let basic_match = self.get_field_info() == sub_type.get_field_info();
        match (self, sub_type) {
            (
                Self::PrimitiveType(PrimitiveType { physical_type, .. }),
                Self::PrimitiveType(PrimitiveType {
                    physical_type: other_physical_type,
                    ..
                }),
            ) => basic_match && physical_type == other_physical_type,
            (
                Self::GroupType { fields, .. },
                Self::GroupType {
                    fields: other_fields,
                    ..
                },
            ) => {
                // build hashmap of name -> Type
                let mut field_map = HashMap::new();
                for field in fields {
                    field_map.insert(field.name(), field);
                }
                for field in other_fields {
                    if !field_map
                        .get(field.name())
                        .map(|tpe| tpe.check_contains(field))
                        .unwrap_or(false)
                    {
                        return false;
                    }
                }
                true
            }
            _ => false,
        }
    }
pub fn check_contains ( & self , sub_type : & ParquetType ) -> bool { let basic_match = self . get_field_info ( ) == sub_type . get_field_info ( ) ; match ( self , sub_type ) { ( Self :: PrimitiveType ( PrimitiveType { physical_type , .. } ) , Self :: PrimitiveType ( PrimitiveType { physical_type : other_physical_type , .. } ) , ) => basic_match && physical_type == other_physical_type , ( Self :: GroupType { fields , .. } , Self :: GroupType { fields : other_fields , .. } , ) => { // build hashmap of name -> Type let mut field_map = HashMap :: new ( ) ; for field in fields { field_map . insert ( field . name ( ) , field ) ; } for field in other_fields { if ! field_map . get ( field . name ( ) ) . map ( | tpe | tpe . check_contains ( field ) ) . unwrap_or ( false ) { return false ; } } true } _ => false , } }
Checks if `sub_type` schema is part of current schema.
Checks if ` sub_type ` schema is part of current schema .
&self
sub_type
&ParquetType