pub enum DataType {
Show 19 variants
Boolean {
column_index: usize,
},
Byte {
column_index: usize,
},
Short {
column_index: usize,
},
Int {
column_index: usize,
},
Long {
column_index: usize,
},
Float {
column_index: usize,
},
Double {
column_index: usize,
},
String {
column_index: usize,
},
Varchar {
column_index: usize,
max_length: u32,
},
Char {
column_index: usize,
max_length: u32,
},
Binary {
column_index: usize,
},
Decimal {
column_index: usize,
precision: u32,
scale: u32,
},
Timestamp {
column_index: usize,
},
TimestampWithLocalTimezone {
column_index: usize,
},
Date {
column_index: usize,
},
Struct {
column_index: usize,
children: Vec<NamedColumn>,
},
List {
column_index: usize,
child: Box<DataType>,
},
Map {
column_index: usize,
key: Box<DataType>,
value: Box<DataType>,
},
Union {
column_index: usize,
variants: Vec<DataType>,
},
}
Expand description
Represents the exact data types supported by ORC.
Each variant holds the column index in order to associate the type with the specific column data present in the stripes.
Variants§
Boolean
1 bit packed data.
Byte
8 bit integer, also called TinyInt.
Short
16 bit integer, also called SmallInt.
Int
32 bit integer.
Long
64 bit integer, also called BigInt.
Float
32 bit floating-point number.
Double
64 bit floating-point number.
String
UTF-8 encoded strings.
Varchar
UTF-8 encoded strings, with an upper length limit on values.
Char
UTF-8 encoded strings, with an upper length limit on values.
Binary
Arbitrary byte array values.
Decimal
Decimal numbers with a fixed precision and scale.
Timestamp
Represents specific date and time, down to the nanosecond, as offset since 1st January 2015, with no timezone.
The date and time represented by values of this column does not change based on the reader’s timezone.
TimestampWithLocalTimezone
Represents specific date and time, down to the nanosecond, as offset since 1st January 2015, with timezone.
The date and time represented by values of this column changes based on the reader’s timezone (is a fixed instant in time).
Date
Represents specific date (without time) as days since the UNIX epoch (1st January 1970 UTC).
Struct
Compound type with named child subtypes, representing a structured collection of children types.
List
Compound type where each value in the column is a list of values of another type, specified by the child type.
Map
Compound type with two children subtypes, key and value, representing key-value pairs for column values.
Union
Compound type which can represent multiple types of data within the same column.
It’s variants represent which types it can be (where each value in the column can only be one of these types).
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn column_index(&self) -> usize
pub fn column_index(&self) -> usize
Retrieve the column index of this data type, used for getting the specific column streams/statistics in the file.
Sourcepub fn children_indices(&self) -> Vec<usize>
pub fn children_indices(&self) -> Vec<usize>
All children column indices.
Sourcepub fn all_indices(&self) -> Vec<usize>
pub fn all_indices(&self) -> Vec<usize>
Includes self index and all children column indices.
pub fn to_arrow_data_type(&self) -> ArrowDataType
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.