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

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

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 has_qualifier(&self, qualifier: &str) -> bool

Whether a visible or hidden lookup identity belongs to qualifier.

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_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 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 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

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 select(input: &Self, columns: &[(String, String)]) -> Self

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

Source

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

Add hidden structured lookup identities for existing logical positions.

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

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