pub enum Type {
PrimitiveType {
basic_info: BasicTypeInfo,
physical_type: Type,
type_length: i32,
scale: i32,
precision: i32,
},
GroupType {
basic_info: BasicTypeInfo,
fields: Vec<TypePtr>,
},
}
Expand description
Representation of a Parquet type.
Used to describe primitive leaf fields and structs, including top-level schema.
Note that the top-level schema is represented using Type::GroupType
whose
repetition is None
.
Variants§
PrimitiveType
Represents a primitive leaf field.
Fields
basic_info: BasicTypeInfo
Basic information about the type.
GroupType
Represents a group of fields (similar to struct).
Fields
basic_info: BasicTypeInfo
Basic information about the type.
Implementations§
Source§impl Type
impl Type
Sourcepub fn primitive_type_builder(
name: &str,
physical_type: PhysicalType,
) -> PrimitiveTypeBuilder<'_>
pub fn primitive_type_builder( name: &str, physical_type: PhysicalType, ) -> PrimitiveTypeBuilder<'_>
Creates primitive type builder with provided field name and physical type.
Sourcepub fn group_type_builder(name: &str) -> GroupTypeBuilder<'_>
pub fn group_type_builder(name: &str) -> GroupTypeBuilder<'_>
Creates group type builder with provided column name.
Sourcepub fn get_basic_info(&self) -> &BasicTypeInfo
pub fn get_basic_info(&self) -> &BasicTypeInfo
Returns BasicTypeInfo
information about the type.
Sourcepub fn get_fields(&self) -> &[TypePtr]
pub fn get_fields(&self) -> &[TypePtr]
Gets the fields from this group type. Note that this will panic if called on a non-group type.
Sourcepub fn get_physical_type(&self) -> PhysicalType
pub fn get_physical_type(&self) -> PhysicalType
Gets physical type of this primitive type. Note that this will panic if called on a non-primitive type.
Sourcepub fn get_precision(&self) -> i32
pub fn get_precision(&self) -> i32
Gets precision of this primitive type. Note that this will panic if called on a non-primitive type.
Sourcepub fn get_scale(&self) -> i32
pub fn get_scale(&self) -> i32
Gets scale of this primitive type. Note that this will panic if called on a non-primitive type.
Sourcepub fn check_contains(&self, sub_type: &Type) -> bool
pub fn check_contains(&self, sub_type: &Type) -> bool
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.
Sourcepub fn is_primitive(&self) -> bool
pub fn is_primitive(&self) -> bool
Returns true
if this type is a primitive type, false
otherwise.
Sourcepub fn is_schema(&self) -> bool
pub fn is_schema(&self) -> bool
Returns true
if this type is the top-level schema type (message type).
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Returns true
if this type is repeated or optional.
If this type doesn’t have repetition defined, we treat it as required.