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
impl RowSchema
Sourcepub fn with_typed_outer_scope(
input: &Self,
outer_columns: &[(String, Option<ColumnType>)],
) -> Self
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.
Sourcepub fn with_typed_outer_identities(
input: &Self,
outer_columns: &[(ColumnIdentity, Option<ColumnType>)],
) -> Self
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
impl RowSchema
pub fn new(columns: Vec<String>) -> Self
Sourcepub fn with_types(columns: Vec<String>, types: Vec<Option<ColumnType>>) -> Self
pub fn with_types(columns: Vec<String>, types: Vec<Option<ColumnType>>) -> Self
Build a positional schema with statically bound SQL types.
Sourcepub fn with_qualified_types(
qualifier: &str,
columns: Vec<String>,
types: Vec<Option<ColumnType>>,
) -> Self
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.
Sourcepub fn with_identities(
columns: Vec<String>,
identities: Vec<ColumnIdentity>,
types: Vec<Option<ColumnType>>,
) -> Self
pub fn with_identities( columns: Vec<String>, identities: Vec<ColumnIdentity>, types: Vec<Option<ColumnType>>, ) -> Self
Build a positional schema from explicit structured identities.
Sourcepub fn from_named_columns(columns: Vec<String>) -> Self
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.
pub fn columns(&self) -> &[String]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, String> ⓘ
Sourcepub fn column_type(&self, logical: usize) -> Option<&ColumnType>
pub fn column_type(&self, logical: usize) -> Option<&ColumnType>
Static SQL type at one logical output position.
Sourcepub fn column_types(&self) -> &[Option<ColumnType>]
pub fn column_types(&self) -> &[Option<ColumnType>]
Static SQL types aligned with Self::columns.
Sourcepub fn identities(&self) -> &[ColumnIdentity]
pub fn identities(&self) -> &[ColumnIdentity]
Structured SQL identities aligned with Self::columns.
Sourcepub fn has_qualifier(&self, qualifier: &str) -> bool
pub fn has_qualifier(&self, qualifier: &str) -> bool
Whether a visible or hidden lookup identity belongs to qualifier.
pub fn identity(&self, logical: usize) -> Option<&ColumnIdentity>
pub fn public_name(&self, logical: usize) -> Option<&str>
pub fn position(&self, name: &str) -> Option<usize>
Sourcepub fn unqualified_position(&self, column: &str) -> Option<usize>
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.
Sourcepub fn qualified_position(&self, qualifier: &str, column: &str) -> Option<usize>
pub fn qualified_position(&self, qualifier: &str, column: &str) -> Option<usize>
Resolve one visible qualified identity to its logical position.
pub fn physical_width(&self) -> usize
Sourcepub fn physical_slot(&self, logical: usize) -> Option<usize>
pub fn physical_slot(&self, logical: usize) -> Option<usize>
Resolve one logical output position to its flattened physical slot.
Sourcepub fn physical_slot_for_identity(
&self,
identity: &ColumnIdentity,
) -> Option<usize>
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.
Sourcepub fn type_of(&self, name: &str) -> Option<&ColumnType>
pub fn type_of(&self, name: &str) -> Option<&ColumnType>
Resolve an unqualified logical identity to its static type.
Sourcepub fn qualified_type(
&self,
qualifier: &str,
column: &str,
) -> Option<&ColumnType>
pub fn qualified_type( &self, qualifier: &str, column: &str, ) -> Option<&ColumnType>
Resolve a qualified logical identity to its static type.
Sourcepub fn qualified_star_layout(
&self,
qualifier: &str,
) -> Vec<(String, usize, Option<ColumnType>)>
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.
Sourcepub fn qualified_star_position_layout(
&self,
qualifier: &str,
) -> Vec<(String, Option<usize>, usize, Option<ColumnType>)>
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.
pub fn column_is_ambiguous(&self, name: &str) -> bool
pub fn qualified_column_is_ambiguous( &self, qualifier: &str, column: &str, ) -> bool
Sourcepub fn select(input: &Self, columns: &[(String, String)]) -> Self
pub fn select(input: &Self, columns: &[(String, String)]) -> Self
Select and optionally rename logical columns while retaining the child’s physical fragments.
Sourcepub fn with_identity_aliases(
input: &Self,
aliases: &[(ColumnIdentity, usize)],
) -> Self
pub fn with_identity_aliases( input: &Self, aliases: &[(ColumnIdentity, usize)], ) -> Self
Add hidden structured lookup identities for existing logical positions.
Sourcepub fn append(input: &Self, names: &[String]) -> Self
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.
Sourcepub fn append_typed(
input: &Self,
names: &[(String, Option<ColumnType>)],
) -> Self
pub fn append_typed( input: &Self, names: &[(String, Option<ColumnType>)], ) -> Self
Append freshly computed values with static SQL output types.
Sourcepub fn join(
left: &Self,
right: &Self,
extra_columns: impl IntoIterator<Item = String>,
) -> Self
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.
pub fn view<'a>(&'a self, row: &'a PhysicalRow) -> PhysicalRowView<'a>
Sourcepub fn relayout_physical_row(
&self,
row: PhysicalRow,
target: &Self,
) -> ExecResult<PhysicalRow>
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§
impl Eq for RowSchema
impl StructuralPartialEq for RowSchema
Auto Trait Implementations§
impl Freeze for RowSchema
impl RefUnwindSafe for RowSchema
impl Send for RowSchema
impl Sync for RowSchema
impl Unpin for RowSchema
impl UnsafeUnpin for RowSchema
impl UnwindSafe for RowSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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