pub trait Partition: 'static + Send {
// Required methods
fn as_any(&self) -> &dyn Any;
fn index(&self) -> usize;
fn row_count(&self) -> Precision<u64>;
fn byte_size(&self) -> 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§
Sourcefn index(&self) -> usize
fn index(&self) -> usize
Some unique identifier for partition. If you have an instance of a DataSource, the indices of emitted partitions will stay stable for every scan in this DataSource.
Sourcefn execute(self: Box<Self>) -> VortexResult<SendableArrayStream>
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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".