Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 583adab

Browse files
committed
refactor(core): rewrite tasks using generators, better pruning (#265)
Signed-off-by: Alex Chi Z <[email protected]>
1 parent 254b2e8 commit 583adab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1510
-1393
lines changed

Diff for: Cargo.lock

+100-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: optd-core/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ serde = { version = "1.0", features = ["derive", "rc"] }
1919
arrow-schema = "53.3.0"
2020
chrono = "0.4"
2121
erased-serde = "0.4"
22+
pollster = "0.4"
23+
stacker = "0.1"
2224

2325
[dev-dependencies]
2426
pretty_assertions = "1.4.1"

Diff for: optd-core/src/cascades.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
88
mod memo;
99
mod optimizer;
10-
mod tasks;
10+
pub mod rule_match;
11+
mod tasks2;
1112

1213
pub use memo::{Memo, NaiveMemo};
1314
pub use optimizer::{CascadesOptimizer, ExprId, GroupId, OptimizerProperties, RelNodeContext};
14-
use tasks::Task;

Diff for: optd-core/src/cascades/memo.rs

+5
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ pub trait Memo<T: NodeType>: 'static + Send + Sync {
158158
) -> Result<ArcPlanNode<T>> {
159159
get_best_group_binding_inner(self, group_id, &mut post_process)
160160
}
161+
162+
/// Get winner of a group and a subgroup.
163+
fn get_group_winner(&self, group_id: GroupId) -> &Winner {
164+
&self.get_group(group_id).info.winner
165+
}
161166
}
162167

163168
fn get_best_group_binding_inner<M: Memo<T> + ?Sized, T: NodeType>(

0 commit comments

Comments
 (0)