Skip to content

Conversation

@st1page
Copy link
Contributor

@st1page st1page commented Feb 16, 2022

What's changed and what's your intention?

  • add condition abstraction for bool expression
    • convert into a bool expression
    • be iterated by conjunctions( A and B and ...) linked with AND
    • can easily rewtrite the InputRef in it with a Mapping
  • use condition in filter and join
  • impl the join predicate create

Checklist

  • I have written necessary docs and comments

Refer to a related PR or issue link (optional)

#106

@st1page st1page requested a review from fuyufjh February 16, 2022 09:11
@st1page st1page changed the title featoptimizer condition feat(optimizer): condition Feb 16, 2022
@st1page st1page changed the title feat(optimizer): condition feat(optimizer): condition && join predicate Feb 16, 2022
@github-actions github-actions bot added the type/feature Type: New feature. label Feb 16, 2022
@st1page st1page requested review from BowenXiao1999 and removed request for BowenXiao1999 and fuyufjh February 16, 2022 09:15
@st1page st1page changed the title feat(optimizer): condition && join predicate WIP feat(optimizer): condition && join predicate Feb 16, 2022
@codecov
Copy link

codecov bot commented Feb 16, 2022

Codecov Report

Merging #367 (2cf90e1) into main (fc24f97) will increase coverage by 0.17%.
The diff coverage is 12.50%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #367      +/-   ##
============================================
+ Coverage     74.23%   74.41%   +0.17%     
  Complexity     2681     2681              
============================================
  Files           863      868       +5     
  Lines         48830    49269     +439     
  Branches       1591     1591              
============================================
+ Hits          36250    36664     +414     
- Misses        11767    11792      +25     
  Partials        813      813              
Flag Coverage Δ
java 62.00% <ø> (ø)
rust 79.68% <12.50%> (+0.18%) ⬆️

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

Impacted Files Coverage Δ
rust/frontend/src/expr/function_call.rs 24.00% <0.00%> (-18.86%) ⬇️
...d/src/optimizer/plan_node/batch_sort_merge_join.rs 0.00% <0.00%> (ø)
...frontend/src/optimizer/plan_node/logical_filter.rs 0.00% <0.00%> (ø)
rust/frontend/src/optimizer/plan_node/mod.rs 28.57% <ø> (ø)
...t/frontend/src/optimizer/plan_node/logical_join.rs 23.21% <3.70%> (-8.87%) ⬇️
rust/frontend/src/utils/condition.rs 11.11% <11.11%> (ø)
...ntend/src/optimizer/plan_node/eq_join_predicate.rs 12.50% <12.50%> (ø)
...rontend/src/optimizer/plan_node/batch_hash_join.rs 30.43% <14.28%> (-1.39%) ⬇️
rust/frontend/src/scheduler/plan_fragmenter.rs 98.51% <100.00%> (+0.01%) ⬆️
rust/meta/src/stream/graph/stream_graph.rs 56.20% <0.00%> (-27.95%) ⬇️
... and 40 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 fc24f97...2cf90e1. Read the comment docs.

@github-actions github-actions bot removed the type/feature Type: New feature. label Feb 16, 2022
@st1page st1page changed the title WIP feat(optimizer): condition && join predicate feat(optimizer): condition && join predicate Feb 17, 2022
@github-actions github-actions bot added the type/feature Type: New feature. label Feb 17, 2022
@fuyufjh
Copy link
Collaborator

fuyufjh commented Feb 17, 2022

Please write a proper PR description, following the pull_request_template

@st1page st1page requested a review from fuyufjh February 17, 2022 05:18
Copy link
Collaborator

@fuyufjh fuyufjh left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@BowenXiao1999 BowenXiao1999 left a comment

Choose a reason for hiding this comment

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

Rest LGTM

/// ```
/// will call the `create` function with left_colsnum = 2 and on_clause is (supposed input_ref
/// count start from 0)
/// ```sql
Copy link
Contributor

Choose a reason for hiding this comment

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

sql?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(it is just pass the doc test

use crate::utils::Condition;
#[derive(Debug, Clone)]
/// the join predicate used in optimizer
pub struct EqJoinPredicate {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is called EqJoinPredicate? So at least it contains one equal preidcate?

Do we have NeqJoinPredicate? etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just for equal join which has equal join and used for hashjoin and sortMergeJoin to easily get the eq and noneq condition. for the non eq join, the condition is enough.

@st1page st1page merged commit 71da88f into main Feb 17, 2022
@st1page st1page deleted the sts/optimizer_condition branch February 17, 2022 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type: New feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants