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§
Sourcetype Encoding: TermEncoding
type Encoding: TermEncoding
The encoding used by this scalar.
Required Methods§
Sourcefn scalar_value(&self) -> &ScalarValue
fn scalar_value(&self) -> &ScalarValue
Returns a reference to the inner scalar value.
Sourcefn into_scalar_value(self) -> ScalarValue
fn into_scalar_value(self) -> ScalarValue
Consumes self
and returns the inner scalar value.
Provided Methods§
Sourcefn to_array(
&self,
number_of_rows: usize,
) -> Result<<Self::Encoding as TermEncoding>::Array, DataFusionError>
fn to_array( &self, number_of_rows: usize, ) -> Result<<Self::Encoding as TermEncoding>::Array, DataFusionError>
Produces a new array with number_of_rows
.