Skip to main content

RowSchema

Struct RowSchema 

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

Immutable column layout shared by an operator and all of its batches.

columns are the logical output labels. slots may point into a wider composite physical row after a projection/rename, allowing those operators to change row shape without moving any values.

Implementations§

Source§

impl RowSchema

Source

pub fn with_relation_qualifier(input: &Self, qualifier: &str) -> Self

Bind every SQL-visible column to one relation qualifier while preserving executor-only internal attributes and rebinding carried retrieval scores to the same relation boundary.

Source

pub fn has_qualifier(&self, qualifier: &str) -> bool

Whether a visible or hidden lookup identity belongs to qualifier.

Source

pub fn has_unqualified_column(&self, column: &str) -> bool

Whether a visible, aliased, or static binding-only identity contains this exact unqualified column, independently of its declared type.

Source

pub fn has_qualified_column(&self, qualifier: &str, column: &str) -> bool

Whether a visible or hidden lookup identity contains this exact qualified column, independently of its static type or ambiguity.

Source

pub fn typed_virtual_identities( &self, ) -> impl Iterator<Item = (&ColumnIdentity, Option<&ColumnType>)>

Iterate over static name-binding identities that deliberately have no physical value slot or wildcard visibility.

Source

pub fn typed_physical_alias_identities( &self, ) -> impl Iterator<Item = (&ColumnIdentity, Option<&ColumnType>)>

Iterate over hidden lookup aliases that resolve to physical value slots while retaining their declared SQL types.

Source

pub fn type_of(&self, name: &str) -> Option<&ColumnType>

Resolve an unqualified logical identity to its static type.

Source

pub fn qualified_type( &self, qualifier: &str, column: &str, ) -> Option<&ColumnType>

Resolve a qualified logical identity to its static type.

Source

pub fn column_is_ambiguous(&self, name: &str) -> bool

Source

pub fn qualified_column_is_ambiguous( &self, qualifier: &str, column: &str, ) -> bool

Source

pub fn with_identity_aliases( input: &Self, aliases: &[(ColumnIdentity, usize)], ) -> Self

Add hidden structured lookup identities for existing logical positions.

Source

pub fn with_physical_identity_aliases( input: &Self, aliases: &[(ColumnIdentity, usize, Option<ColumnType>)], ) -> Self

Add hidden SQL lookup identities that point at explicit physical slots. Unlike Self::with_identity_aliases, these slots do not need a SQL-visible logical column owner.

Source

pub fn with_physical_internal_aliases( input: &Self, aliases: &[(InternalColumnRef, usize, Option<ColumnType>)], ) -> Self

Add executor-only relation attributes at explicit physical slots.

Source

pub fn with_trailing_internal_aliases(input: &Self, trailing: &Self) -> Self

Restore structural identities from a row scope that occupies the trailing physical slots of this schema.

Source

pub fn with_wildcard_hidden_positions( input: &Self, positions: impl IntoIterator<Item = usize>, ) -> Self

Mark source-owned logical metadata attributes as explicitly addressable but absent from * expansion. The identity is positional, so an ordinary user column with the same text remains visible.

Source

pub fn internal_slot(&self, column: InternalColumnRef) -> Option<usize>

Source

pub fn unique_internal_column_for_slot( &self, slot: usize, ) -> Option<InternalColumnRef>

Return the sole executor-only identity attached to a physical slot. Slots with no structural identity or with multiple aliases are intentionally unresolved.

Source

pub fn internal_type(&self, column: InternalColumnRef) -> Option<&ColumnType>

Source

pub fn with_score_source( input: &Self, qualifier: Option<&str>, column: InternalColumnRef, ) -> Self

Mark an existing internal attribute as the score carried by one retrieval relation. This semantic tag is schema metadata and never enters SQL name lookup or wildcard expansion.

Source

pub fn with_rebound_score_sources(input: &Self, qualifier: Option<&str>) -> Self

Rebind every carried score source at a relation-alias boundary while retaining its opaque internal attribute identity.

Source

pub fn score_source_column( &self, qualifier: Option<&str>, ) -> Option<InternalColumnRef>

Source

pub fn score_source_is_ambiguous(&self, qualifier: Option<&str>) -> bool

Source

pub fn score_source_slot(&self, qualifier: Option<&str>) -> Option<usize>

Source

pub fn with_typed_virtual_identities( input: &Self, identities: &[(ColumnIdentity, Option<ColumnType>)], ) -> Self

Add statically typed hidden lookup identities that have no physical value slot. Visible columns and star expansion remain unchanged, while binders can resolve the identities and their declared SQL types.

Source

pub fn with_typed_conflicting_virtual_identities( input: &Self, identities: &[(ColumnIdentity, Option<ColumnType>)], ) -> Self

Add binding-only identities and preserve collisions as ambiguous names. This models SQL scopes that expose a hidden generated column for explicit lookup while deliberately excluding it from wildcard expansion.

Source§

impl RowSchema

Source

pub fn with_typed_outer_scope( input: &Self, outer_columns: &[(String, Option<ColumnType>)], ) -> Self

Overlay a statically typed correlated outer scope. The outer columns remain hidden from schema iteration and star expansion, but both qualified and unqualified lookup aliases retain their declared SQL types for expression binding.

Source

pub fn with_typed_outer_identities( input: &Self, outer_columns: &[(ColumnIdentity, Option<ColumnType>)], ) -> Self

Overlay a correlated outer scope carried as structured identities.

Source

pub fn with_outer_schema(input: &Self, outer: &Self) -> Self

Overlay an existing positional outer scope while preserving its complete structured lookup layout and sharing its physical value fragments.

Source§

impl RowSchema

Source

pub fn append(input: &Self, names: &[String]) -> Self

Append freshly-computed values to an existing physical row. Reusing an existing output name replaces its logical slot just like map insertion.

Source

pub fn append_typed( input: &Self, names: &[(String, Option<ColumnType>)], ) -> Self

Append freshly computed values with static SQL output types.

Source

pub fn append_hidden_typed(input: &Self, types: &[Option<ColumnType>]) -> Self

Extend the physical row with anonymous values that have no SQL name or wildcard presence. Callers may attach structured SQL identities or internal relation attributes to the resulting physical slots.

Source

pub fn append_internal_typed( input: &Self, columns: &[(InternalColumnRef, Option<ColumnType>)], ) -> Self

Append computed executor attributes under structural identities while keeping them out of the SQL name and wildcard namespaces.

Source

pub fn join( left: &Self, right: &Self, extra_columns: impl IntoIterator<Item = String>, ) -> Self

Compose two child layouts while retaining duplicate logical labels. Qualified and positional resolution can then distinguish both input slots without copying either value fragment.

Source

pub fn view<'a>(&'a self, row: &'a PhysicalRow) -> PhysicalRowView<'a>

Source

pub fn relayout_physical_row( &self, row: PhysicalRow, target: &Self, ) -> ExecResult<PhysicalRow>

Re-express a row emitted under this schema in target’s complete physical layout without cloning any values. Visible columns are matched by logical position; hidden lookup aliases are matched by their structured identity. This is used when two equivalent operator pipelines expose the same logical row through different physical slot arrangements.

Source§

impl RowSchema

Source

pub fn new(columns: Vec<String>) -> Self

Source

pub fn with_types(columns: Vec<String>, types: Vec<Option<ColumnType>>) -> Self

Build a positional schema with statically bound SQL types.

Source

pub fn with_qualified_types( qualifier: &str, columns: Vec<String>, types: Vec<Option<ColumnType>>, ) -> Self

Build a positional schema whose visible columns all belong to one relation qualifier while retaining their public names verbatim.

Source

pub fn with_identities( columns: Vec<String>, identities: Vec<ColumnIdentity>, types: Vec<Option<ColumnType>>, ) -> Self

Build a positional schema from explicit structured identities.

Source

pub fn with_internal_relation_types( relation: InternalRelationId, types: Vec<Option<ColumnType>>, ) -> Self

Build a physical row layout whose values are addressable only through an opaque internal relation identity. It contributes no SQL-visible columns and therefore cannot affect * expansion or name binding.

Source

pub fn from_named_columns(columns: Vec<String>) -> Self

Build the lookup semantics of a named compatibility row. An exact bare key in a map is authoritative even when qualified metadata keys share its suffix; physical relational schemas continue to treat multiple visible owners as ambiguous.

Source§

impl RowSchema

Source

pub fn wildcard_position_visible(&self, position: usize) -> bool

Whether one logical source attribute participates in * expansion.

Source

pub fn columns(&self) -> &[String]

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter(&self) -> Iter<'_, String>

Source

pub fn column_type(&self, logical: usize) -> Option<&ColumnType>

Static SQL type at one logical output position.

Source

pub fn column_types(&self) -> &[Option<ColumnType>]

Static SQL types aligned with Self::columns.

Source

pub fn identities(&self) -> &[ColumnIdentity]

Structured SQL identities aligned with Self::columns.

Source

pub fn identity(&self, logical: usize) -> Option<&ColumnIdentity>

Source

pub fn public_name(&self, logical: usize) -> Option<&str>

Source

pub fn position(&self, name: &str) -> Option<usize>

Source

pub fn unqualified_position(&self, column: &str) -> Option<usize>

Resolve one visible unqualified SQL identity to its logical position. Ambiguous names deliberately do not select an arbitrary owner.

Source

pub fn qualified_position(&self, qualifier: &str, column: &str) -> Option<usize>

Resolve one visible qualified identity to its logical position.

Source

pub fn physical_width(&self) -> usize

Source

pub fn physical_slot(&self, logical: usize) -> Option<usize>

Resolve one logical output position to its flattened physical slot.

Source

pub fn physical_type(&self, physical: usize) -> Option<&ColumnType>

Static type attached to one flattened physical slot, including executor-only internal attributes that have no logical SQL position.

Source

pub fn physical_slot_for_identity( &self, identity: &ColumnIdentity, ) -> Option<usize>

Resolve a structured SQL identity, including a hidden JOIN USING alias, to its flattened physical slot. Ambiguous identities deliberately return None rather than selecting an arbitrary source value.

Source

pub fn qualified_star_layout( &self, qualifier: &str, ) -> Vec<(String, usize, Option<ColumnType>)>

Physical projection layout for qualifier.* in relation-column order. Hidden identities introduced by JOIN ... USING remain selectable, so each side’s wildcard retains its own merged-column value.

Source

pub fn qualified_star_position_layout( &self, qualifier: &str, ) -> Vec<(String, Option<usize>, usize, Option<ColumnType>)>

Bound layout for qualifier.*. Visible columns retain their logical positions; hidden aliases such as the suppressed side of JOIN ... USING expose only their physical slot.

Source§

impl RowSchema

Source

pub fn without_internal_attributes( input: &Self, columns: &[InternalColumnRef], ) -> Self

Remove selected executor-only identities after their consumer has run. The physical fragments remain shareable until the next canonical boundary, where now-unreferenced slots are naturally discarded.

Source

pub fn select(input: &Self, columns: &[(String, String)]) -> Self

Select and optionally rename logical columns while retaining the child’s physical fragments.

Trait Implementations§

Source§

impl Clone for RowSchema

Source§

fn clone(&self) -> RowSchema

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RowSchema

Source§

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

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

impl Default for RowSchema

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RowSchema

Source§

impl From<Vec<String>> for RowSchema

Source§

fn from(columns: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RowSchema

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RowSchema

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> ErasedDestructor for T
where T: 'static,

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.