Skip to main content

Consolidate

Trait Consolidate 

Source
pub trait Consolidate {
    type Output;

    // Required method
    fn consolidate(self) -> Self::Output;
}
Expand description

Trait for consolidating chunked types into contiguous storage.

§Output Type

The Output associated type defines what the consolidated result is:

  • SuperArray::Output = Array
  • SuperTable::Output = Table

§When to Use

  • After parallel batch processing that returns chunked results
  • Before operations requiring contiguous memory (e.g., FFI, certain operations)
  • When you need to serialise to formats requiring single buffers

§Naming

The consolidated result uses the name from the source. Call .rename() or equivalent if you need a different name.

Required Associated Types§

Source

type Output

The type produced after consolidation.

Required Methods§

Source

fn consolidate(self) -> Self::Output

Consolidates chunked data into contiguous storage.

Consumes self and returns a consolidated Output.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Consolidate for Vec<Table>

Available on crate feature chunked only.
Source§

fn consolidate(self) -> Table

Consolidate a vector of tables with the same schema into a single table.

Returns an empty table if the input is empty. For a single table, returns it directly without copying.

When the arena feature is enabled, all column buffers are written into a single allocation then sliced into typed views, reducing allocation count from O(columns) to O(1). The resulting buffers are SharedBuffer-backed; mutations trigger copy-on-write.

Without the arena feature, falls back to per-column concat.

Source§

type Output = Table

Implementors§