SortableTermEncoding

Struct SortableTermEncoding 

Source
pub struct SortableTermEncoding;
Expand description

The sortable term encoding allows us to represent the expected SPARQL ordering using DataFusion’s built-in ordering for structs.

This is meant as a work-around until we can define a custom ordering in DataFusion. Alternatively, we could also write a custom operator for sorting SPARQL solutions.

Implementations§

Source§

impl SortableTermEncoding

Source

pub fn fields() -> Fields

Returns the fields of this encoding.

Source

pub fn encode_term( &self, term: Result<TermRef<'_>, ThinError>, ) -> Result<SortableTermScalar, DataFusionError>

Encodes the term as a SortableTermScalar.

Trait Implementations§

Source§

impl Debug for SortableTermEncoding

Source§

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

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

impl TermEncoder<SortableTermEncoding> for TermRefSortableTermEncoder

Source§

type Term<'data> = TermRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = Result<<TermRefSortableTermEncoder as TermEncoder<SortableTermEncoding>>::Term<'data>, ThinError>>, ) -> Result<<SortableTermEncoding as TermEncoding>::Array, DataFusionError>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: Result<<TermRefSortableTermEncoder as TermEncoder<SortableTermEncoding>>::Term<'_>, ThinError>, ) -> Result<<SortableTermEncoding as TermEncoding>::Scalar, DataFusionError>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<SortableTermEncoding> for TypedValueRefSortableTermEncoder

Source§

type Term<'data> = TypedValueRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = Result<<TypedValueRefSortableTermEncoder as TermEncoder<SortableTermEncoding>>::Term<'data>, ThinError>>, ) -> Result<<SortableTermEncoding as TermEncoding>::Array, DataFusionError>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: Result<<TypedValueRefSortableTermEncoder as TermEncoder<SortableTermEncoding>>::Term<'_>, ThinError>, ) -> Result<<SortableTermEncoding as TermEncoding>::Scalar, DataFusionError>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoding for SortableTermEncoding

Source§

type Array = SortableTermArray

Represents a wrapper for Arrow arrays of this encoding. This can be used in conjunction with TermDecoder to obtain the values from an Arrow array.
Source§

type Scalar = SortableTermScalar

Represents a wrapper for Arrow scalars of this encoding. This can be used in conjunction with TermDecoder to obtain the values from an Arrow scalar.
Source§

fn name(&self) -> EncodingName

Returns the name of the encoding.
Source§

fn data_type(&self) -> DataType

Returns the DataType that is used for this encoding. Read more
Source§

fn try_new_array( &self, array: Arc<dyn Array>, ) -> Result<<SortableTermEncoding as TermEncoding>::Array, DataFusionError>

Checks whether array contains a value with the correct encoding (i.e., type and possibly metadata checks). If yes, returns an instance of Self::Array. Otherwise, an error is returned.
Source§

fn try_new_scalar( &self, scalar: ScalarValue, ) -> Result<<SortableTermEncoding as TermEncoding>::Scalar, DataFusionError>

Checks whether scalar contains a value with the correct encoding (i.e., type and possibly metadata checks). If yes, returns an instance of Self::Scalar. Otherwise, an error is returned.
Source§

fn try_new_datum( &self, value: ColumnarValue, number_rows: usize, ) -> Result<EncodingDatum<Self>, DataFusionError>

Checks whether value contains a value with the correct encoding (i.e., type and possibly metadata checks). If yes, returns a datum that either wraps an array or a scalar. Otherwise, an error is returned.

Auto Trait Implementations§

Blanket Implementations§

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,