Skip to main content

LiteralValue

Enum LiteralValue 

Source
pub enum LiteralValue {
Show 22 variants Boolean(bool), Int8(i8), Int16(i16), Int32(i32), Int64(i64), UInt8(u8), UInt16(u16), UInt32(u32), UInt64(u64), Float32(f32), Float64(f64), Utf8(String), LargeUtf8(String), Decimal128 { raw: i128, precision: u8, scale: i8, }, Date32(i32), Date64(i64), Time32 { raw: i32, unit: TimeUnit, }, Time64 { raw: i64, unit: TimeUnit, }, Timestamp { raw: i64, unit: TimeUnit, }, Duration { raw: i64, unit: TimeUnit, }, IntervalMonthDayNano { months: i32, days: i32, nanoseconds: i64, }, Null(DataType),
}
Expand description

Typed scalar literal in native expression IR; nulls carry an explicit DataType.

Self::data_type is total: every variant names one Arrow type, so validation types a literal without a schema. PartialEq only, because Float32 and Float64 carry NaN; two literals that compare equal have the same type and the same non-NaN value.

Variants§

§

Boolean(bool)

Boolean scalar.

§

Int8(i8)

Signed 8-bit integer scalar.

§

Int16(i16)

Signed 16-bit integer scalar.

§

Int32(i32)

Signed 32-bit integer scalar.

§

Int64(i64)

Signed 64-bit integer scalar.

§

UInt8(u8)

Unsigned 8-bit integer scalar.

§

UInt16(u16)

Unsigned 16-bit integer scalar.

§

UInt32(u32)

Unsigned 32-bit integer scalar.

§

UInt64(u64)

Unsigned 64-bit integer scalar.

§

Float32(f32)

32-bit floating-point scalar.

§

Float64(f64)

64-bit floating-point scalar.

§

Utf8(String)

UTF-8 string scalar with Arrow Utf8 type.

§

LargeUtf8(String)

UTF-8 string scalar with Arrow LargeUtf8 type.

§

Decimal128

Arrow Decimal128 scalar.

raw is the unscaled integer payload. precision and scale are the Arrow decimal metadata; the mathematical value is raw * 10^-scale.

Fields

§raw: i128

Unscaled 128-bit decimal payload.

§precision: u8

Maximum number of significant decimal digits.

§scale: i8

Decimal scale in Arrow’s representation.

§

Date32(i32)

Arrow Date32 scalar, encoded as days since the Unix epoch.

§

Date64(i64)

Arrow Date64 scalar, encoded as milliseconds since the Unix epoch.

§

Time32

Arrow Time32 scalar.

raw is the count of unit intervals since midnight.

Fields

§raw: i32

Time-of-day value in the given unit.

§unit: TimeUnit

Time resolution. Arrow permits only seconds and milliseconds.

§

Time64

Arrow Time64 scalar.

raw is the count of unit intervals since midnight.

Fields

§raw: i64

Time-of-day value in the given unit.

§unit: TimeUnit

Time resolution. Arrow permits only microseconds and nanoseconds.

§

Timestamp

Arrow timestamp scalar without a timezone.

raw is the count of unit intervals since the Unix epoch.

Fields

§raw: i64

Epoch-relative timestamp value in the given unit.

§unit: TimeUnit

Timestamp resolution.

§

Duration

Arrow duration scalar.

raw is the count of unit intervals.

Fields

§raw: i64

Duration value in the given unit.

§unit: TimeUnit

Duration resolution.

§

IntervalMonthDayNano

Arrow Interval(MonthDayNano) scalar.

Fields

§months: i32

Month component.

§days: i32

Day component.

§nanoseconds: i64

Nanosecond component.

§

Null(DataType)

Typed SQL null literal.

Implementations§

Source§

impl LiteralValue

Source

pub fn data_type(&self) -> DataType

Return the Arrow data type represented by this literal.

Trait Implementations§

Source§

impl Clone for LiteralValue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LiteralValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for LiteralValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for LiteralValue

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LiteralValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.