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_relation_qualifier(input: &Self, qualifier: &str) -> Self
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.
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.
Sourcepub fn has_unqualified_column(&self, column: &str) -> bool
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.
Sourcepub fn has_qualified_column(&self, qualifier: &str, column: &str) -> bool
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.
Sourcepub fn typed_virtual_identities(
&self,
) -> impl Iterator<Item = (&ColumnIdentity, Option<&ColumnType>)>
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.
Sourcepub fn typed_physical_alias_identities(
&self,
) -> impl Iterator<Item = (&ColumnIdentity, Option<&ColumnType>)>
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.
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.
pub fn column_is_ambiguous(&self, name: &str) -> bool
pub fn qualified_column_is_ambiguous( &self, qualifier: &str, column: &str, ) -> bool
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 with_physical_identity_aliases(
input: &Self,
aliases: &[(ColumnIdentity, usize, Option<ColumnType>)],
) -> Self
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.
Sourcepub fn with_physical_internal_aliases(
input: &Self,
aliases: &[(InternalColumnRef, usize, Option<ColumnType>)],
) -> Self
pub fn with_physical_internal_aliases( input: &Self, aliases: &[(InternalColumnRef, usize, Option<ColumnType>)], ) -> Self
Add executor-only relation attributes at explicit physical slots.
Sourcepub fn with_trailing_internal_aliases(input: &Self, trailing: &Self) -> Self
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.
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.
pub fn internal_slot(&self, column: InternalColumnRef) -> Option<usize>
Sourcepub fn unique_internal_column_for_slot(
&self,
slot: usize,
) -> Option<InternalColumnRef>
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.
pub fn internal_type(&self, column: InternalColumnRef) -> Option<&ColumnType>
Sourcepub fn with_score_source(
input: &Self,
qualifier: Option<&str>,
column: InternalColumnRef,
) -> Self
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.
Sourcepub fn with_rebound_score_sources(input: &Self, qualifier: Option<&str>) -> Self
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.
pub fn score_source_column( &self, qualifier: Option<&str>, ) -> Option<InternalColumnRef>
pub fn score_source_is_ambiguous(&self, qualifier: Option<&str>) -> bool
pub fn score_source_slot(&self, qualifier: Option<&str>) -> Option<usize>
Sourcepub fn with_typed_virtual_identities(
input: &Self,
identities: &[(ColumnIdentity, Option<ColumnType>)],
) -> Self
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.
Sourcepub fn with_typed_conflicting_virtual_identities(
input: &Self,
identities: &[(ColumnIdentity, Option<ColumnType>)],
) -> Self
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
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.
Sourcepub fn with_outer_schema(input: &Self, outer: &Self) -> Self
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
impl RowSchema
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.
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.
Sourcepub fn append_internal_typed(
input: &Self,
columns: &[(InternalColumnRef, Option<ColumnType>)],
) -> Self
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.
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.
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 with_internal_relation_types(
relation: InternalRelationId,
types: Vec<Option<ColumnType>>,
) -> Self
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.
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.
Source§impl RowSchema
impl RowSchema
Sourcepub fn wildcard_position_visible(&self, position: usize) -> bool
pub fn wildcard_position_visible(&self, position: usize) -> bool
Whether one logical source attribute participates in * expansion.
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.
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_type(&self, physical: usize) -> Option<&ColumnType>
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.
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 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.
Source§impl RowSchema
impl RowSchema
Sourcepub fn without_internal_attributes(
input: &Self,
columns: &[InternalColumnRef],
) -> Self
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.
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