Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(planner): integrate with PlanRoot #726

Merged
merged 8 commits into from
Mar 9, 2022
Merged

Conversation

xiangjinwu
Copy link
Contributor

@xiangjinwu xiangjinwu commented Mar 7, 2022

What's changed and what's your intention?

The planner will return PlanRoot rather than PlanRef for insert and query, as it is the entry point for the optimization phase. Additionally, PlanRoot::as_subplan would transform it back in cases where it is actually a subtree of a bigger plan rather than the root.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #726 (3666723) into main (f45d650) will increase coverage by 0.06%.
The diff coverage is 86.36%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #726      +/-   ##
============================================
+ Coverage     72.35%   72.42%   +0.06%     
  Complexity     2758     2758              
============================================
  Files           911      911              
  Lines         52925    52953      +28     
  Branches       1783     1783              
============================================
+ Hits          38295    38351      +56     
+ Misses        13738    13710      -28     
  Partials        892      892              
Flag Coverage Δ
java 61.16% <ø> (ø)
rust 77.18% <86.36%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rust/frontend/src/handler/explain.rs 0.00% <0.00%> (ø)
.../frontend/src/optimizer/plan_node/batch_project.rs 0.00% <0.00%> (ø)
...frontend/src/optimizer/plan_node/batch_seq_scan.rs 22.22% <0.00%> (-11.12%) ⬇️
rust/frontend/src/optimizer/mod.rs 72.50% <100.00%> (+72.50%) ⬆️
...rontend/src/optimizer/plan_node/logical_project.rs 90.56% <100.00%> (+0.12%) ⬆️
...t/frontend/src/optimizer/plan_node/logical_scan.rs 86.95% <100.00%> (+2.74%) ⬆️
rust/frontend/src/planner/insert.rs 100.00% <100.00%> (ø)
rust/frontend/src/planner/mod.rs 100.00% <100.00%> (ø)
rust/frontend/src/planner/query.rs 100.00% <100.00%> (ø)
rust/frontend/src/planner/statement.rs 100.00% <100.00%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f45d650...3666723. Read the comment docs.

@xiangjinwu xiangjinwu force-pushed the rust-frontend-planner-root branch from b2ce791 to 1731f5e Compare March 8, 2022 09:49
@xiangjinwu xiangjinwu changed the title feat(planner): (Preview) integrate PlanRoot feat(planner): integrate with PlanRoot Mar 8, 2022
@xiangjinwu xiangjinwu marked this pull request as ready for review March 8, 2022 10:24
Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines 71 to 81
let (exprs, expr_aliases) = self
.out_fields
.ones()
.zip_eq(self.schema.fields)
.map(|(index, field)| {
(
InputRef::new(index, field.data_type).to_expr_impl(),
Some(field.name),
)
})
.unzip();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I must have read this code piece somewhere..., Take a look at impl ColPrunable for LogicalFilter {. You can do refactoring in another pr if they are repeated.

@xiangjinwu xiangjinwu merged commit 6bbc0be into main Mar 9, 2022
@xiangjinwu xiangjinwu deleted the rust-frontend-planner-root branch March 9, 2022 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants