Skip to main content

TermColumn

Struct TermColumn 

Source
pub struct TermColumn { /* private fields */ }
Expand description

One variable’s column: packed TermIds (0 = unbound).

Implementations§

Source§

impl TermColumn

Source

pub fn from_ids(ids: Vec<u32>) -> Self

Build a column from interned TermIds.

Source

pub fn from_terms( dict: &TermDict, values: Vec<EncodedTerm>, ) -> Result<Self, ExecError>

Intern bound terms into dict and store their ids.

Source

pub fn from_optional_terms( dict: &TermDict, values: Vec<Option<EncodedTerm>>, ) -> Result<Self, ExecError>

Intern optional terms (None = unbound, stored as 0).

Source

pub fn empty() -> Self

Empty column.

Source

pub fn unbound(len: usize) -> Self

len unbound cells (0).

Source

pub fn len(&self) -> usize

Number of rows.

Source

pub fn is_empty(&self) -> bool

Whether the column has no rows.

Source

pub fn is_bound(&self, row: usize) -> bool

Whether row i is SPARQL-bound (id != 0).

Source

pub fn any_bound(&self) -> bool

Whether any cell is bound (id != 0). Short-circuits at the first bound cell — the join filter emptiness gates ask exactly this question and must not pay a full dedupe scan for it. Column ids are interned by construction, so id != 0 is the authoritative boundness test; no dict lookup is needed to confirm it.

Source

pub fn id_at(&self, row: usize) -> u32

TermId at row (0 if OOB).

Source

pub fn ids(&self) -> &[u32]

Borrow the id buffer.

Source

pub fn term_at(&self, dict: &TermDict, row: usize) -> Option<EncodedTerm>

Resolve the encoded term at row (None if unbound).

Source

pub fn terms(&self, dict: &TermDict) -> Vec<Option<EncodedTerm>>

Resolve every cell under one dict lock (None = unbound).

Source

pub fn gather(&self, indices: &[usize]) -> Self

Gather rows by index into a new column (preserves unbound ids).

Source

pub fn gather_take(&self, indices: &[u32]) -> Self

Gather via u32 row indexes (same as Self::gather, no re-intern).

Unlike a term-level gather, this does not touch the dictionary: the id buffer is remapped by index.

Source

pub fn gather_take_nullable(&self, indices: &[Option<u32>]) -> Self

Like Self::gather_take, but null index slots become unbound output rows.

Used by left outer join to attach right-carry columns where unmatched probe rows have a null right index.

Source

pub fn gather_coalesce( &self, left_indices: &[u32], other: &Self, right_indices: &[u32], ) -> Result<Self, ExecError>

Coalesce two columns at parallel index arrays: left if bound, else right.

This is the soft-shared gather path after a join: if OPTIONAL left ?x unbound, take the right’s ?x; if left already bound, keep it. Soft coalesce is SPARQL compatible mapping on term identity = TermId.

Source

pub fn gather_coalesce_nullable( &self, left_indices: &[u32], other: &Self, right_indices: &[Option<u32>], ) -> Result<Self, ExecError>

Coalesce with nullable right indexes (None = unbound when left is unbound).

Trait Implementations§

Source§

impl Clone for TermColumn

Source§

fn clone(&self) -> TermColumn

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TermColumn

Source§

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

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

impl PartialEq for TermColumn

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for TermColumn

Source§

impl StructuralPartialEq for TermColumn

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

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

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,