Struct parquet::schema::types::PrimitiveTypeBuilder
source · pub struct PrimitiveTypeBuilder<'a> { /* private fields */ }
Expand description
A builder for primitive types. All attributes are optional
except the name and physical type.
Note that if not specified explicitly, Repetition::OPTIONAL
is used.
Implementations§
source§impl<'a> PrimitiveTypeBuilder<'a>
impl<'a> PrimitiveTypeBuilder<'a>
sourcepub fn new(name: &'a str, physical_type: PhysicalType) -> Self
pub fn new(name: &'a str, physical_type: PhysicalType) -> Self
Creates new primitive type builder with provided field name and physical type.
sourcepub fn with_repetition(self, repetition: Repetition) -> Self
pub fn with_repetition(self, repetition: Repetition) -> Self
Sets Repetition
for this field and returns itself.
sourcepub fn with_converted_type(self, converted_type: ConvertedType) -> Self
pub fn with_converted_type(self, converted_type: ConvertedType) -> Self
Sets ConvertedType
for this field and returns itself.
sourcepub fn with_logical_type(self, logical_type: Option<LogicalType>) -> Self
pub fn with_logical_type(self, logical_type: Option<LogicalType>) -> Self
Sets LogicalType
for this field and returns itself.
If only the logical type is populated for a primitive type, the converted type
will be automatically populated, and can thus be omitted.
sourcepub fn with_length(self, length: i32) -> Self
pub fn with_length(self, length: i32) -> Self
Sets type length and returns itself.
This is only applied to FIXED_LEN_BYTE_ARRAY and INT96 (INTERVAL) types, because
they maintain fixed size underlying byte array.
By default, value is 0
.
sourcepub fn with_precision(self, precision: i32) -> Self
pub fn with_precision(self, precision: i32) -> Self
Sets precision for Parquet DECIMAL physical type and returns itself.
By default, it equals to 0
and used only for decimal context.
sourcepub fn with_scale(self, scale: i32) -> Self
pub fn with_scale(self, scale: i32) -> Self
Sets scale for Parquet DECIMAL physical type and returns itself.
By default, it equals to 0
and used only for decimal context.