use super::{ExecResult, PhysicalRow, PhysicalRowView, RowSchema};
pub trait RowSchemaExecution {
fn view<'a>(&'a self, row: &'a PhysicalRow) -> PhysicalRowView<'a>;
fn relayout_physical_row(
&self,
row: PhysicalRow,
target: &RowSchema,
) -> ExecResult<PhysicalRow>;
}
impl RowSchemaExecution for RowSchema {
fn view<'a>(&'a self, row: &'a PhysicalRow) -> PhysicalRowView<'a> {
PhysicalRowView { schema: self, row }
}
fn relayout_physical_row(
&self,
row: PhysicalRow,
target: &RowSchema,
) -> ExecResult<PhysicalRow> {
let slots = self.relayout_slots(target)?;
Ok(row.project_slots(&slots))
}
}