Skip to content

Commit 62775a6

Browse files
feat(layout): add push-based pipelines and the scan that runs them (#10391)
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent e277ccd commit 62775a6

30 files changed

Lines changed: 2798 additions & 149 deletions

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vortex-layout/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pin-project-lite = { workspace = true }
3535
prost = { workspace = true }
3636
rustc-hash = { workspace = true }
3737
sketches-ddsketch = { workspace = true }
38+
smallvec = { workspace = true }
3839
termtree = { workspace = true }
3940
tokio = { workspace = true, features = ["rt"], optional = true }
4041
tracing = { workspace = true }

‎vortex-layout/src/plan/mod.rs‎

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

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.
4+
//! Scan planning.
95
10-
mod children;
11-
mod display;
12-
mod lower;
13-
mod optimize;
14-
pub mod optimizer;
15-
mod plans;
16-
mod typed;
17-
mod vtable;
18-
19-
pub use children::PlanChildren;
20-
pub use display::PlanIndentedFormatter;
21-
pub use display::PlanSummaryExtractor;
22-
pub use display::PlanTreeContext;
23-
pub use display::PlanTreeDisplay;
24-
pub use display::PlanTreeExtractor;
25-
pub use lower::lower;
26-
pub use optimize::optimize;
27-
pub use plans::Concat;
28-
pub use plans::ConcatData;
29-
pub use plans::ConcatPlan;
30-
pub use plans::Eval;
31-
pub use plans::EvalData;
32-
pub use plans::EvalPlan;
33-
pub use plans::ListPack;
34-
pub use plans::ListPackData;
35-
pub use plans::ListPackPlan;
36-
pub use plans::Pack;
37-
pub use plans::PackData;
38-
pub use plans::PackPlan;
39-
pub use plans::RowIdx;
40-
pub use plans::RowIdxData;
41-
pub use plans::RowIdxPlan;
42-
pub use plans::SegmentScan;
43-
pub use plans::SegmentScanData;
44-
pub use plans::SegmentScanPlan;
45-
pub use plans::Take;
46-
pub use plans::TakePlan;
47-
pub use plans::plan_row_idx_expression;
48-
pub use plans::row_idx_dtype;
49-
pub use typed::DynPlan;
50-
pub use typed::Plan;
51-
pub use typed::PlanParts;
52-
pub use typed::PlanRef;
53-
use vortex_error::VortexResult;
54-
use vortex_error::vortex_bail;
55-
pub use vtable::PlanId;
56-
pub use vtable::PlanVTable;
57-
58-
/// Returns an error when `children` does not have exactly `expected` entries.
59-
pub(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)]
74-
mod tests;
6+
pub mod physical;

vortex-layout/src/plan/children.rs renamed to vortex-layout/src/plan/physical/children.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use once_cell::sync::OnceCell;
88
use vortex_error::VortexResult;
99
use vortex_error::vortex_err;
1010

11-
use crate::plan::PlanRef;
11+
use crate::plan::physical::PlanRef;
1212

1313
type ChildInitializer = dyn Fn(usize) -> VortexResult<PlanRef> + 'static + Send + Sync;
1414

File renamed without changes.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ use crate::layouts::list::OFFSETS_CHILD_INDEX;
2424
use crate::layouts::list::VALIDITY_CHILD_INDEX;
2525
use crate::layouts::struct_::Struct;
2626
use crate::layouts::struct_::StructLayout;
27-
use crate::plan::ConcatPlan;
28-
use crate::plan::ListPackPlan;
29-
use crate::plan::PackPlan;
30-
use crate::plan::PlanChildren;
31-
use crate::plan::PlanRef;
32-
use crate::plan::SegmentScanPlan;
33-
use crate::plan::TakePlan;
27+
use crate::plan::physical::ConcatPlan;
28+
use crate::plan::physical::ListPackPlan;
29+
use crate::plan::physical::PackPlan;
30+
use crate::plan::physical::PlanChildren;
31+
use crate::plan::physical::PlanRef;
32+
use crate::plan::physical::SegmentScanPlan;
33+
use crate::plan::physical::TakePlan;
3434

3535
/// Constructs a physical-plan fixture from `layout` for tests.
3636
///
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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

Comments
 (0)