pub enum DataType {
Show 22 variants
Null,
Binary,
Boolean,
Byte,
Short,
Integer,
Long,
Float,
Double,
Decimal {
scale: Option<i32>,
precision: Option<i32>,
},
String,
Char(i32),
VarChar(i32),
Date,
Timestamp,
TimestampNtz,
CalendarInterval,
YearMonthInterval {
start_field: Option<i32>,
end_field: Option<i32>,
},
DayTimeInterval {
start_field: Option<i32>,
end_field: Option<i32>,
},
Array {
element_type: Box<DataType>,
contains_null: bool,
},
Map {
key_type: Box<DataType>,
value_type: Box<DataType>,
value_contains_null: bool,
},
Struct(Box<StructType>),
}
Expand description
A set of DataTypes which represent Spark DataTypes.
These DataTypes variants are used to constructs a schema representation
§Example:
let schema = StructType::new(vec![
StructField {
name: "name",
data_type: DataType::String,
nullable: false,
metadata: None,
},
StructField {
name: "age",
data_type: DataType::Short,
nullable: true,
metadata: None,
},
]);
Variants§
Null
NullType
Binary
BinaryType
Boolean
BooleanType
Byte
ByteType
Short
ShortType
Integer
IntegerType
Long
LongType
Float
FloatType
Double
DoubleType
Decimal
DecimalType with scale and precision
String
StringType
Char(i32)
CharType with length
VarChar(i32)
VarCharType with length
Date
DateType
Timestamp
TimestampType
TimestampNtz
TimestampNtzType
CalendarInterval
CalendarIntervalType
YearMonthInterval
YearMonthIntervalType
DayTimeInterval
DayTimeInterval Type
Array
ArrayType
Map
MapType
Struct(Box<StructType>)
StructType
Implementations§
Source§impl DataType
impl DataType
pub fn from_str_name(value: &str) -> DataType
pub fn to_proto_type(&self) -> DataType
Trait Implementations§
Source§impl From<DataType> for CastToType
impl From<DataType> for CastToType
Source§fn from(value: DataType) -> CastToType
fn from(value: DataType) -> CastToType
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request