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.
Trait Implementations§
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)