-
Notifications
You must be signed in to change notification settings - Fork 454
fix(interactive): Support Multiple Matches in IR Core #3134
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
Conversation
Committed-by: bingqing.lbq from Dev container
Committed-by: bingqing.lbq from Dev container
.unwrap_or(true) | ||
} | ||
_ => false, | ||
impl pb::LogicalPlan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -155,7 +168,7 @@ impl TryFrom<pb::LogicalPlan> for LogicalPlan { | |||
return Err(ParsePbError::EmptyFieldError("Node::opr".to_string())); | |||
} | |||
} | |||
|
|||
plan.clean_redundant_nodes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems would occur a duplicated clean_redundant_nodes() since it is also called in append_operator_as_node()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, and edit a testcase
let new_curr_node_rst = match opr.opr.as_ref().unwrap() { | ||
Opr::Pattern(pattern) => { | ||
|
||
let new_curr_node_rst = match opr.opr.as_ref() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can directly unwrap() since it is already checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to avoid unwrap in official code
false | ||
} | ||
} else { | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if store_meta is not provided, params.tables.is_empty() also indicates all_labels()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
1. remove `append_root` method 2. avoid repeated `clean_redundant_nodes()` use in try_from pb::LogicalPlan to LogicalPlan 3. Change the logic of `is_all_parameters()`. Now, as well as the params.tables.is_empty(), it is all parameters, no matter whether the store meta is provided or not 4. Remove an error testcase about multiple matches because it contains nested branch, which will be supoorted in the future version
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3134 +/- ##
=======================================
Coverage 42.64% 42.64%
=======================================
Files 100 100
Lines 10817 10817
=======================================
Hits 4613 4613
Misses 6204 6204 Continue to review full report in Codecov by Sentry.
|
} | ||
} | ||
|
||
fn is_node_dummy(node: &Node) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not implement as a member function of Node? Similar for is_node_scan. Furthermore, dummy not a good name for the function, call it root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -469,6 +469,9 @@ message SinkVineyard { | |||
schema.Schema graph_schema = 2; | |||
} | |||
|
|||
// A dummy node to delegate a source opr for multiple scan cases. | |||
message RootScan {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not like RootScan
, Simply call it Root
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What do these changes do?
As titled, support Multiple Matches in IR Core
RootScan
after initialization by default. This dummyRootScan
may be later used to support multiplescan
.RootScan
clean_redundant_nodes
method to clean useless nodes. There are two kinds of reduandant nodes:Scan
node with no child and dummyRootScan
with zero or only single child.Related issue number
Fixes #3052 #3062