Skip to main content

Partition

Trait Partition 

Source
pub trait Partition: 'static + Send {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn row_count(&self) -> Option<Precision<u64>>;
    fn byte_size(&self) -> Option<Precision<u64>>;
    fn execute(self: Box<Self>) -> VortexResult<SendableArrayStream>;

    // Provided method
    fn serialize(&self) -> VortexResult<Option<Vec<u8>>> { ... }
}
Expand description

A partition represents a unit of work that can be executed to produce a stream of arrays.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Downcast the partition to a concrete type.

Source

fn row_count(&self) -> Option<Precision<u64>>

Returns an estimate of the row count for this partition.

Source

fn byte_size(&self) -> Option<Precision<u64>>

Returns an estimate of the byte size for this partition.

Source

fn execute(self: Box<Self>) -> VortexResult<SendableArrayStream>

Executes the partition, returning an array stream.

This method must be fast. The returned stream should be lazy — all non-trivial work (I/O, decoding, filtering) must be deferred to when the stream is polled. Expensive operations should be spawned onto the runtime to enable parallel execution across threads.

Provided Methods§

Source

fn serialize(&self) -> VortexResult<Option<Vec<u8>>>

Serialize this partition for a remote worker.

Implementors§