Skip to main content

vortex_layout/plan/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Physical plans for scans.
5//!
6//! A plan is a tree of physical operators over a row domain. Operator identity and
7//! operator-specific state do not depend on the source layout kind, so rewrites can reason about a
8//! plan's shape alone. The common child container can initialize individual slots lazily.
9
10mod children;
11mod display;
12mod lower;
13mod optimize;
14pub mod optimizer;
15mod plans;
16mod typed;
17mod vtable;
18
19pub use children::PlanChildren;
20pub use display::PlanIndentedFormatter;
21pub use display::PlanSummaryExtractor;
22pub use display::PlanTreeContext;
23pub use display::PlanTreeDisplay;
24pub use display::PlanTreeExtractor;
25pub use lower::lower;
26pub use optimize::optimize;
27pub use plans::Concat;
28pub use plans::ConcatData;
29pub use plans::ConcatPlan;
30pub use plans::Eval;
31pub use plans::EvalData;
32pub use plans::EvalPlan;
33pub use plans::ListPack;
34pub use plans::ListPackData;
35pub use plans::ListPackPlan;
36pub use plans::Pack;
37pub use plans::PackData;
38pub use plans::PackPlan;
39pub use plans::RowIdx;
40pub use plans::RowIdxData;
41pub use plans::RowIdxPlan;
42pub use plans::SegmentScan;
43pub use plans::SegmentScanData;
44pub use plans::SegmentScanPlan;
45pub use plans::Take;
46pub use plans::TakePlan;
47pub use plans::plan_row_idx_expression;
48pub use plans::row_idx_dtype;
49pub use typed::DynPlan;
50pub use typed::Plan;
51pub use typed::PlanParts;
52pub use typed::PlanRef;
53use vortex_error::VortexResult;
54use vortex_error::vortex_bail;
55pub use vtable::PlanId;
56pub use vtable::PlanVTable;
57
58/// Returns an error when `children` does not have exactly `expected` entries.
59pub(crate) fn check_child_count(
60    name: &str,
61    children: &PlanChildren,
62    expected: usize,
63) -> VortexResult<()> {
64    if children.len() != expected {
65        vortex_bail!(
66            "{name} expects {expected} children but got {}",
67            children.len()
68        );
69    }
70    Ok(())
71}
72
73#[cfg(test)]
74mod tests;