Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
ScalarValue in datafusion::scalar - Rust
[go: Go Back, main page]

Enum datafusion::scalar::ScalarValue[][src]

pub enum ScalarValue {
Show 24 variants Boolean(Option<bool>), Float32(Option<f32>), Float64(Option<f64>), Int8(Option<i8>), Int16(Option<i16>), Int32(Option<i32>), Int64(Option<i64>), UInt8(Option<u8>), UInt16(Option<u16>), UInt32(Option<u32>), UInt64(Option<u64>), Utf8(Option<String>), LargeUtf8(Option<String>), Binary(Option<Vec<u8>>), LargeBinary(Option<Vec<u8>>), List(Option<Box<Vec<ScalarValue>>>, Box<DataType>), Date32(Option<i32>), Date64(Option<i64>), TimestampSecond(Option<i64>), TimestampMillisecond(Option<i64>), TimestampMicrosecond(Option<i64>), TimestampNanosecond(Option<i64>), IntervalYearMonth(Option<i32>), IntervalDayTime(Option<i64>),
}
Expand description

Represents a dynamically typed, nullable single value. This is the single-valued counter-part of arrow’s Array.

Variants

Boolean

true or false value

Tuple Fields of Boolean

0: Option<bool>
Float32

32bit float

Tuple Fields of Float32

0: Option<f32>
Float64

64bit float

Tuple Fields of Float64

0: Option<f64>
Int8

signed 8bit int

Tuple Fields of Int8

0: Option<i8>
Int16

signed 16bit int

Tuple Fields of Int16

0: Option<i16>
Int32

signed 32bit int

Tuple Fields of Int32

0: Option<i32>
Int64

signed 64bit int

Tuple Fields of Int64

0: Option<i64>
UInt8

unsigned 8bit int

Tuple Fields of UInt8

0: Option<u8>
UInt16

unsigned 16bit int

Tuple Fields of UInt16

0: Option<u16>
UInt32

unsigned 32bit int

Tuple Fields of UInt32

0: Option<u32>
UInt64

unsigned 64bit int

Tuple Fields of UInt64

0: Option<u64>
Utf8

utf-8 encoded string.

Tuple Fields of Utf8

0: Option<String>
LargeUtf8

utf-8 encoded string representing a LargeString’s arrow type.

Tuple Fields of LargeUtf8

0: Option<String>
Binary

binary

Tuple Fields of Binary

0: Option<Vec<u8>>
LargeBinary

large binary

Tuple Fields of LargeBinary

0: Option<Vec<u8>>
List

list of nested ScalarValue (boxed to reduce size_of(ScalarValue))

Tuple Fields of List

0: Option<Box<Vec<ScalarValue>>>1: Box<DataType>
Date32

Date stored as a signed 32bit int

Tuple Fields of Date32

0: Option<i32>
Date64

Date stored as a signed 64bit int

Tuple Fields of Date64

0: Option<i64>
TimestampSecond

Timestamp Second

Tuple Fields of TimestampSecond

0: Option<i64>
TimestampMillisecond

Timestamp Milliseconds

Tuple Fields of TimestampMillisecond

0: Option<i64>
TimestampMicrosecond

Timestamp Microseconds

Tuple Fields of TimestampMicrosecond

0: Option<i64>
TimestampNanosecond

Timestamp Nanoseconds

Tuple Fields of TimestampNanosecond

0: Option<i64>
IntervalYearMonth

Interval with YearMonth unit

Tuple Fields of IntervalYearMonth

0: Option<i32>
IntervalDayTime

Interval with DayTime unit

Tuple Fields of IntervalDayTime

0: Option<i64>

Implementations

Getter for the DataType of the value

Calculate arithmetic negation for a scalar value

whether this value is null or not.

Converts a scalar value into an 1-row array.

Converts an iterator of references ScalarValue into an ArrayRef corresponding to those values. For example,

Returns an error if the iterator is empty or if the ScalarValues are not all the same type

Example

use datafusion::scalar::ScalarValue;
use arrow::array::{ArrayRef, BooleanArray};

let scalars = vec![
  ScalarValue::Boolean(Some(true)),
  ScalarValue::Boolean(None),
  ScalarValue::Boolean(Some(false)),
];

// Build an Array from the list of ScalarValues
let array = ScalarValue::iter_to_array(scalars.into_iter())
  .unwrap();

let expected: ArrayRef = std::sync::Arc::new(
  BooleanArray::from(vec![
    Some(true),
    None,
    Some(false)
  ]
));

assert_eq!(&array, &expected);

Converts a scalar value into an array of size rows.

Converts a value in array at index into a ScalarValue

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

convert the value to a Literal expression

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Create a Null instance of ScalarValue for this datatype

The type returned in the event of a conversion error.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.