|
| 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 | +
|
| 13 | +mod children; |
| 14 | +mod display; |
| 15 | +mod lower; |
| 16 | +pub mod operator; |
| 17 | +pub(crate) mod operators; |
| 18 | +mod optimize; |
| 19 | +pub mod optimizer; |
| 20 | +pub mod pipeline; |
| 21 | +mod plans; |
| 22 | +mod typed; |
| 23 | +mod vtable; |
| 24 | + |
| 25 | +pub use children::PlanChildren; |
| 26 | +pub use display::PlanIndentedFormatter; |
| 27 | +pub use display::PlanSummaryExtractor; |
| 28 | +pub use display::PlanTreeContext; |
| 29 | +pub use display::PlanTreeDisplay; |
| 30 | +pub use display::PlanTreeExtractor; |
| 31 | +pub use lower::lower; |
| 32 | +pub use optimize::optimize; |
| 33 | +pub use plans::Concat; |
| 34 | +pub use plans::ConcatData; |
| 35 | +pub use plans::ConcatPlan; |
| 36 | +pub use plans::Eval; |
| 37 | +pub use plans::EvalData; |
| 38 | +pub use plans::EvalPlan; |
| 39 | +pub use plans::ListPack; |
| 40 | +pub use plans::ListPackData; |
| 41 | +pub use plans::ListPackPlan; |
| 42 | +pub use plans::Pack; |
| 43 | +pub use plans::PackData; |
| 44 | +pub use plans::PackPlan; |
| 45 | +pub use plans::RowIdx; |
| 46 | +pub use plans::RowIdxData; |
| 47 | +pub use plans::RowIdxPlan; |
| 48 | +pub use plans::SegmentScan; |
| 49 | +pub use plans::SegmentScanData; |
| 50 | +pub use plans::SegmentScanPlan; |
| 51 | +pub use plans::Take; |
| 52 | +pub use plans::TakePlan; |
| 53 | +pub use plans::plan_row_idx_expression; |
| 54 | +pub use plans::row_idx_dtype; |
| 55 | +pub use typed::DynPlan; |
| 56 | +pub use typed::Plan; |
| 57 | +pub use typed::PlanParts; |
| 58 | +pub use typed::PlanRef; |
| 59 | +use vortex_error::VortexResult; |
| 60 | +use vortex_error::vortex_bail; |
| 61 | +pub use vtable::PlanId; |
| 62 | +pub use vtable::PlanVTable; |
| 63 | + |
| 64 | +/// Returns an error when `children` does not have exactly `expected` entries. |
| 65 | +pub(crate) fn check_child_count( |
| 66 | + name: &str, |
| 67 | + children: &PlanChildren, |
| 68 | + expected: usize, |
| 69 | +) -> VortexResult<()> { |
| 70 | + if children.len() != expected { |
| 71 | + vortex_bail!( |
| 72 | + "{name} expects {expected} children but got {}", |
| 73 | + children.len() |
| 74 | + ); |
| 75 | + } |
| 76 | + Ok(()) |
| 77 | +} |
| 78 | + |
| 79 | +#[cfg(test)] |
| 80 | +mod tests; |
0 commit comments