EncodingScalar

Trait EncodingScalar 

Source
pub trait EncodingScalar {
    type Encoding: TermEncoding;

    // Required methods
    fn encoding(&self) -> &Self::Encoding;
    fn scalar_value(&self) -> &ScalarValue;
    fn into_scalar_value(self) -> ScalarValue;

    // Provided method
    fn to_array(
        &self,
        number_of_rows: usize,
    ) -> Result<<Self::Encoding as TermEncoding>::Array, DataFusionError> { ... }
}
Expand description

Represents an Arrow ScalarValue with a specific TermEncoding.

The constructors of types that implement EncodingScalar are meant to ensure that the ScalarValue upholds all invariants of the encoding.

Required Associated Types§

Source

type Encoding: TermEncoding

The encoding used by this scalar.

Required Methods§

Source

fn encoding(&self) -> &Self::Encoding

Obtains the encoding instance for this scalar.

Source

fn scalar_value(&self) -> &ScalarValue

Returns a reference to the inner scalar value.

Source

fn into_scalar_value(self) -> ScalarValue

Consumes self and returns the inner scalar value.

Provided Methods§

Source

fn to_array( &self, number_of_rows: usize, ) -> Result<<Self::Encoding as TermEncoding>::Array, DataFusionError>

Produces a new array with number_of_rows.

Implementors§