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.
Sourcepub(crate) fn has_single_repeated_child(&self) -> bool
pub(crate) fn has_single_repeated_child(&self) -> bool
Returns true
if this type is a group with a single child field that is repeated
.
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more