Skip to main content

vortex_layout/plan/physical/
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//!
10//! [`operator`] defines the execution contracts, `operators` implements the concrete sources
11//! and stages, and [`pipeline`] compiles and runs them.
12
13mod children;
14mod display;
15mod lower;
16pub mod operator;
17pub(crate) mod operators;
18mod optimize;
19pub mod optimizer;
20pub mod pipeline;
21mod plans;
22pub(crate) mod selection;
23mod typed;
24mod vtable;
25
26pub use children::PlanChildren;
27pub use display::PlanIndentedFormatter;
28pub use display::PlanSummaryExtractor;
29pub use display::PlanTreeContext;
30pub use display::PlanTreeDisplay;
31pub use display::PlanTreeExtractor;
32pub use lower::lower;
33pub use optimize::optimize;
34pub use plans::Concat;
35pub use plans::ConcatData;
36pub use plans::ConcatPlan;
37pub use plans::Eval;
38pub use plans::EvalData;
39pub use plans::EvalPlan;
40pub use plans::Filter;
41pub use plans::FilterData;
42pub use plans::FilterPlan;
43pub use plans::LegacyStats;
44pub use plans::LegacyStatsData;
45pub use plans::LegacyStatsPlan;
46pub use plans::ListPack;
47pub use plans::ListPackData;
48pub use plans::ListPackPlan;
49pub use plans::Pack;
50pub use plans::PackData;
51pub use plans::PackPlan;
52pub use plans::RowIdx;
53pub use plans::RowIdxData;
54pub use plans::RowIdxPlan;
55pub use plans::SegmentScan;
56pub use plans::SegmentScanData;
57pub use plans::SegmentScanPlan;
58pub use plans::Share;
59pub use plans::ShareData;
60pub use plans::SharePlan;
61pub use plans::Take;
62pub use plans::TakePlan;
63pub use plans::Zoned;
64pub use plans::ZonedData;
65pub use plans::ZonedPlan;
66pub use plans::plan_row_idx_expression;
67pub use plans::row_idx_dtype;
68pub use typed::DynPlan;
69pub use typed::Plan;
70pub(crate) use typed::PlanByPtr;
71pub use typed::PlanParts;
72pub use typed::PlanRef;
73use vortex_error::VortexResult;
74use vortex_error::vortex_bail;
75pub use vtable::PlanId;
76pub use vtable::PlanVTable;
77
78/// Returns an error when `children` does not have exactly `expected` entries.
79pub(crate) fn check_child_count(
80    name: &str,
81    children: &PlanChildren,
82    expected: usize,
83) -> VortexResult<()> {
84    if children.len() != expected {
85        vortex_bail!(
86            "{name} expects {expected} children but got {}",
87            children.len()
88        );
89    }
90    Ok(())
91}
92
93#[cfg(test)]
94mod tests;