pub enum LogicalType {
Show 20 variants
Invalid,
SqlNull,
Boolean,
Tinyint,
UTinyint,
Smallint,
USmallint,
Integer,
UInteger,
Bigint,
UBigint,
Float,
Double,
Char(u32, CharLengthUnits),
Varchar(Option<u32>, CharLengthUnits),
Date,
DateTime,
Time,
Decimal(Option<u8>, Option<u8>),
Tuple(Vec<LogicalType>),
}Expand description
Sqlrs type conversion: sqlparser::ast::DataType -> LogicalType -> arrow::datatypes::DataType
Variants§
Invalid
SqlNull
Boolean
Tinyint
UTinyint
Smallint
USmallint
Integer
UInteger
Bigint
UBigint
Float
Double
Char(u32, CharLengthUnits)
Varchar(Option<u32>, CharLengthUnits)
Date
DateTime
Time
Decimal(Option<u8>, Option<u8>)
Tuple(Vec<LogicalType>)
Implementations§
Source§impl LogicalType
impl LogicalType
pub fn type_trans<T: 'static>() -> Option<LogicalType>
pub fn raw_len(&self) -> Option<usize>
pub fn numeric() -> Vec<LogicalType>
pub fn is_numeric(&self) -> bool
pub fn is_signed_numeric(&self) -> bool
pub fn is_unsigned_numeric(&self) -> bool
pub fn is_floating_point_numeric(&self) -> bool
pub fn max_logical_type( left: &LogicalType, right: &LogicalType, ) -> Result<LogicalType, DatabaseError>
pub fn can_implicit_cast(from: &LogicalType, to: &LogicalType) -> bool
Trait Implementations§
Source§impl Clone for LogicalType
impl Clone for LogicalType
Source§fn clone(&self) -> LogicalType
fn clone(&self) -> LogicalType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogicalType
impl Debug for LogicalType
Source§impl<'de> Deserialize<'de> for LogicalType
impl<'de> Deserialize<'de> for LogicalType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LogicalType
impl Display for LogicalType
Source§impl Hash for LogicalType
impl Hash for LogicalType
Source§impl Ord for LogicalType
impl Ord for LogicalType
Source§fn cmp(&self, other: &LogicalType) -> Ordering
fn cmp(&self, other: &LogicalType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LogicalType
impl PartialEq for LogicalType
Source§impl PartialOrd for LogicalType
impl PartialOrd for LogicalType
Source§impl ReferenceSerialization for LogicalType
impl ReferenceSerialization for LogicalType
fn encode<W: Write>( &self, writer: &mut W, is_direct: bool, reference_tables: &mut ReferenceTables, ) -> Result<(), DatabaseError>
fn decode<T: Transaction, R: Read>( reader: &mut R, drive: Option<(&T, &SharedLruCache<TableName, TableCatalog>)>, reference_tables: &ReferenceTables, ) -> Result<Self, DatabaseError>
Source§impl Serialize for LogicalType
impl Serialize for LogicalType
Source§impl TryFrom<DataType> for LogicalType
impl TryFrom<DataType> for LogicalType
sqlparser datatype to logical type
impl Eq for LogicalType
impl StructuralPartialEq for LogicalType
Auto Trait Implementations§
impl Freeze for LogicalType
impl RefUnwindSafe for LogicalType
impl Send for LogicalType
impl Sync for LogicalType
impl Unpin for LogicalType
impl UnwindSafe for LogicalType
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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