Skip to main content

PlanVTable

Trait PlanVTable 

Source
pub trait PlanVTable:
    'static
    + Clone
    + Sized
    + Send
    + Sync
    + Debug {
    type PlanData: 'static + Send + Sync + Clone + Debug;
    type Metadata: SerializeMetadata + DeserializeMetadata + Debug;

    // Required methods
    fn id(&self) -> PlanId;
    fn metadata(plan: &Plan<Self>) -> Option<Self::Metadata>;

    // Provided methods
    fn fmt(plan: &Plan<Self>, formatter: &mut Formatter<'_>) -> Result { ... }
    fn with_children(
        plan: &Plan<Self>,
        children: &PlanChildren,
        data: &mut Self::PlanData,
    ) -> VortexResult<()> { ... }
    fn child_name(plan: &Plan<Self>, index: usize) -> Cow<'_, str> { ... }
    fn compile(
        plan: &Plan<Self>,
        rows: Range<u64>,
        mask: &Mask,
        compiler: &mut Compiler<'_>,
    ) -> VortexResult<Option<Chain>> { ... }
    fn reach(
        plan: &Plan<Self>,
        rows: Range<u64>,
        at: &Reach,
        visit: &mut dyn FnMut(SegmentId, Range<u64>),
    ) -> VortexResult<()> { ... }
}
Expand description

Operator-specific behavior for a typed Plan.

Common fields — dtype, row count, and children — are stored outside the erased operator data. Implementations own only their operator-specific data, its metadata codec, and a callback for refreshing cached data after generic child replacement.

Operators describe physical work over a row domain. Their identity and operator-specific data do not depend on the source layout kind. The common lazy-child storage may nevertheless own a hidden source-layout reference used for on-demand lowering.

Required Associated Types§

Source

type PlanData: 'static + Send + Sync + Clone + Debug

Operator-specific data, excluding children.

Children belong in PlanParts::children so that traversal and rewriting can discover them generically.

Source

type Metadata: SerializeMetadata + DeserializeMetadata + Debug

Serialized form of PlanData.

Required Methods§

Source

fn id(&self) -> PlanId

Returns the globally unique operator ID.

Source

fn metadata(plan: &Plan<Self>) -> Option<Self::Metadata>

Returns the serializable metadata for this operator.

Returns None when the operator holds state that cannot be serialized.

Provided Methods§

Source

fn fmt(plan: &Plan<Self>, formatter: &mut Formatter<'_>) -> Result

Writes operator-specific fields after the plan’s standard display summary.

Source

fn with_children( plan: &Plan<Self>, children: &PlanChildren, data: &mut Self::PlanData, ) -> VortexResult<()>

Refreshes cloned operator data after the common child container is replaced.

The plan layer clones PlanData, replaces the children externally, and invokes this callback. Implementations validate the new children and update any derived values in data; they do not rebuild the plan itself.

Source

fn child_name(plan: &Plan<Self>, index: usize) -> Cow<'_, str>

Returns the display name of the child at index.

Source

fn compile( plan: &Plan<Self>, rows: Range<u64>, mask: &Mask, compiler: &mut Compiler<'_>, ) -> VortexResult<Option<Chain>>

Compiles this plan over rows of its row domain, restricted to mask, into a chain: a source and the stages after it, producing the rows mask selects in row order, or None when that is no row. rows lies within the plan’s row domain and mask is as long as rows.

A plan compiles its children through compiler and either adds stages to a child’s chain or joins several children’s chains with a source of its own. Compiling does no IO.

Source

fn reach( plan: &Plan<Self>, rows: Range<u64>, at: &Reach, visit: &mut dyn FnMut(SegmentId, Range<u64>), ) -> VortexResult<()>

Visits every segment compiling this plan over rows could read, under any mask, with the rows of the scanned plan it is read for, so a segment more than one reader reads is decoded once. at maps this plan’s rows to the scanned plan’s.

The default visits nothing, so the segments under a plan that does not override it are read by each reader alone.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§