Skip to main content

TableV

Struct TableV 

Source
pub struct TableV {
    pub name: String,
    pub fields: Vec<Arc<Field>>,
    pub cols: Vec<ArrayV>,
    pub offset: usize,
    pub len: usize,
    pub active_col_selection: Option<Vec<usize>>,
}
Expand description

§TableView

Row-aligned view into a Table over [offset .. offset+len).

§Fields

  • name: table name, propagated from the parent Table.
  • fields: shared schema, one Arc<Field> per column.
  • cols: column windows as ArrayV, all with the same (offset, len).
  • offset: starting row, relative to parent table.
  • len: number of rows in the window.
  • active_col_selection: optional column selection indices for lazy column filtering. When set, access methods transparently return only the selected columns. Row windowing is handled by offset/len.

§Notes

  • Construction from a Table/Arc<Table> is zero-copy for column data.
  • Use from_self to take sub-windows cheaply.
  • Use to_table() to materialise an owned copy of just this window.
  • Column helpers (col, col_ix, col_vec) provide ergonomic access.
  • When active_col_selection is set, all access methods filter transparently. The underlying fields and cols vectors retain the full schema so that selections can be composed or cleared without reallocating.

Fields§

§name: String

Table name

§fields: Vec<Arc<Field>>

Full schema - one entry per column in the parent table

§cols: Vec<ArrayV>

Full column windows - one ArrayV per column, all with the same (offset, len)

§offset: usize

Row offset from start of parent table

§len: usize

Number of rows in the window

§active_col_selection: Option<Vec<usize>>

Lazy column selection. When Some, only these indices into fields/cols are considered active. Access methods, iteration, and materialisation all filter through this selection transparently.

Implementations§

Source§

impl TableV

Source

pub fn from_table(table: Table, offset: usize, len: usize) -> TableV

Creates a new TableView over table[offset .. offset+len). Provides a non-owning view into a subrange of the table.

Source

pub fn from_arc_table(table: Arc<Table>, offset: usize, len: usize) -> TableV

Creates a new TableView over table[offset .. offset+len). Provides a non-owning view into a subrange of the table.

Source

pub fn from_self(&self, offset: usize, len: usize) -> TableV

Derives a subwindow from this TableView, adjusted by offset and len. Preserves the active column selection from the parent view.

Source

pub fn clear_col_selection(&mut self)

Clear the active column selection, making all columns active again.

Source

pub fn active_col_indices(&self) -> Vec<usize>

Returns the active column indices, or all indices if no selection is set.

Source

pub fn has_col_selection(&self) -> bool

Returns true if a column selection is active.

Source

pub fn is_empty(&self) -> bool

Returns true if the window contains no rows.

Source

pub fn end(&self) -> usize

Returns the exclusive end row index of the window.

Source

pub fn n_cols(&self) -> usize

Returns the number of active columns in the table window.

Source

pub fn n_rows(&self) -> usize

Returns the number of rows in the window.

Source

pub fn len(&self) -> usize

Returns the number of rows in the window.

Source

pub fn name(&self) -> &str

Returns the name of the table.

Source

pub fn col_names(&self) -> Vec<&str>

Returns the names of all active columns.

Source

pub fn rename_columns( &mut self, mapping: &[(&str, &str)], ) -> Result<(), MinarrowError>

Rename columns in place. Each pair is (old_name, new_name).

Only searches active columns when a selection is set. Returns an error if any old name is not found among active columns. This is metadata-only - array data is not touched.

Source

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

Returns the position of a column by name within the active selection.

Source

pub fn col_window(&self, idx: usize) -> Option<ArrayV>

Returns the window of the column at the given active index.

Source

pub fn col_name(&self, idx: usize) -> Option<&str>

Returns the name of the column at the given active index.

Source

pub fn nullable_cols(&self) -> Vec<bool>

Returns a Vec<bool> indicating which active columns are nullable.

Source

pub fn to_table(&self) -> Table

Materialise the view into an owned Table. Respects active column selection.

Source

pub fn apply_cols<E>( &self, f: impl FnMut(&Arc<Field>, &ArrayV) -> Result<FieldArray, E>, ) -> Result<Table, E>

Apply a transformation to each active column view, producing a new table.

The closure receives the field and column view directly without materialisation. To pass a column through unchanged, materialise with view.to_array(). To transform, operate on the view and return the result as a FieldArray.

Source

pub fn extract_column(field: &Field, window: &ArrayV) -> FieldArray

Converts a column window into an owned FieldArray, slicing the array and copying data. Copies the data.

Source

pub fn gather_rows(&self, indices: &[usize]) -> Table

Gather specific row indices from this view into a materialised Table. Indices are relative to this view’s window.

Trait Implementations§

Source§

impl Clone for TableV

Source§

fn clone(&self) -> TableV

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 ColumnSelection for TableV

Available on crate feature select only.
Source§

type View = TableV

The view type returned by multi-field selection e.g. TableV
Source§

type ColumnView = ArrayV

A single column view by index e.g. ArrayV
Source§

type ColumnOwned = FieldArray

An owned single field by name via .get() e.g. FieldArray for Table, Arc for Cube
Source§

fn c<S>(&self, selection: S) -> TableV
where S: FieldSelector,

Select fields/columns by name, index, or range Read more
Source§

fn get(&self, field: &str) -> Option<FieldArray>

Get a single field by name, returning an owned value.
Source§

fn col_ix(&self, idx: usize) -> Option<ArrayV>

Get a single column view by index
Source§

fn col_vec(&self) -> Vec<ArrayV>

Get all columns as views
Source§

fn get_cols(&self) -> Vec<Arc<Field>>

Get the fields for field resolution
Source§

fn col(&self, name: &str) -> Self::View

Alias for c - select column by name
Source§

impl Concatenate for TableV

Source§

fn concat(self, other: TableV) -> Result<TableV, MinarrowError>

Concatenates two table views by materialising both to owned tables, concatenating them, and wrapping the result back in a view.

§Notes
  • This operation copies data from both views to create owned tables.
  • The resulting view has offset=0 and length equal to the combined length.
Source§

impl Debug for TableV

Source§

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

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

impl Display for TableV

Source§

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

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

impl From<Arc<Table>> for TableV

Arc

-> TableV conversion. Creates a zero-copy view over the Arc’d table.

Source§

fn from(table: Arc<Table>) -> TableV

Converts to this type from the input type.
Source§

impl From<Table> for TableV

Table -> TableV conversion

Source§

fn from(table: Table) -> TableV

Converts to this type from the input type.
Source§

impl From<TableV> for Table

TableV -> Table conversion. Respects active column selection.

Source§

fn from(view: TableV) -> Table

Converts to this type from the input type.
Source§

impl PartialEq for TableV

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl RowSelection for TableV

Available on crate feature select only.
Source§

type View = TableV

The view type returned by selection operations
Source§

fn r<S>(&self, selection: S) -> TableV
where S: DataSelector,

Select rows by index or range Read more
Source§

fn get_row_count(&self) -> usize

Get the count for data resolution
Source§

impl Shape for TableV

Source§

fn shape(&self) -> ShapeDim

Returns arbitrary Shape dimension for any data shape
Source§

fn shape_1d(&self) -> usize

Returns the first dimension shape Read more
Source§

fn shape_2d(&self) -> (usize, usize)

Returns the first and second dimension shapes Read more
Source§

fn shape_3d(&self) -> (usize, usize, usize)

Returns the first, second and third dimension shapes Read more
Source§

fn shape_4d(&self) -> (usize, usize, usize, usize)

Returns the first, second, third and fourth dimension shapes Read more
Source§

impl StructuralPartialEq for TableV

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> CustomValue for T
where T: Any + Send + Sync + Clone + PartialEq + Debug,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Downcasts the type as Any
Source§

fn deep_clone(&self) -> Arc<dyn CustomValue>

Returns a deep clone of the object. Read more
Source§

fn eq_box(&self, other: &(dyn CustomValue + 'static)) -> bool

Performs semantic equality on the boxed object. Read more
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> Print for T
where T: Display,

Source§

fn print(&self)
where Self: Display,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.