-
Notifications
You must be signed in to change notification settings - Fork 436
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
[GIE Physical] Support LateProject Strategy when Fetching Properties. #2451
Conversation
4b12c1f
to
9ac564d
Compare
443bac0
to
ede8b7e
Compare
ede8b7e
to
e48e607
Compare
// This would be refined as: | ||
// In Logical Plan: `Source + EdgeExpand(ExpandE) + GetV` | ||
// In Physical Plan: | ||
// 1. on distributed graph store, `Source + EdgeExpand(ExpandV) + Shuffle + Auxilia` |
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.
Now we do not have Auxilia
? Why still comment it as Auxilia
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.
Updated as GetV
merged_params.columns.push(column.clone()); | ||
} | ||
} | ||
fn process_tag_columns(builder: &mut JobBuilder, tag: Option<TagId>, columns_opt: ColumnsOpt) { |
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.
Is JobBuilder still used to build the Pegasus plan? or Physical plan?
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.
Physical plan.
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.
Then probably PhysicalBuilder is better than JobBuilder.
fn process_tag_columns(builder: &mut JobBuilder, tag: Option<TagId>, columns_opt: ColumnsOpt) { | ||
if columns_opt.len() > 0 { | ||
let tag_pb = tag.map(|tag_id| (tag_id as i32).into()); | ||
builder.shuffle(tag_pb.clone()); |
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 have to shuffle here? We do not verify wether it is single thread?
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 function would be called only when plan_meta.is_partition()
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.
Then why not put plan_meta.is_partition()
in this function?
Let the caller be free of the context.
Moreover, better comment this function to improve the understanding.
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. Move this into post_process_vars()
function.
let node_meta = plan_meta.get_curr_node_meta().unwrap(); | ||
let tag_columns = node_meta.get_tag_columns(); | ||
let len = tag_columns.len(); | ||
if len == 0 { |
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.
Better not using return
in the middle. Can do this instead:
if len == 1 && !is_order_or_group {
} else if len != 0 {
} else {
Ok(())
}
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
@Graph.OptOut( | ||
method = "g_V_order_byXnameX_name", | ||
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest", | ||
reason = "unsupoorted") |
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.
the reason should not be unsupported (btw: unsupoorted misspelled)
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.
Updated as "project (with shuffle) after order occurs bug"
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.
"Projection may introduce additional shuffling that can break the order. "
sample_ratio: 1.0, | ||
extra: Default::default(), | ||
}; | ||
let auxilia = pb::GetV { tag: tag_pb.clone(), opt: 4, params: Some(params), alias: tag_pb.clone() }; |
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.
Better comment what is opt: 4
.
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
merge_query_param_columns(merged_params, other_params.is_all_columns, &other_params.columns); | ||
other_params.columns.clear(); | ||
other_params.is_all_columns = false; | ||
// Fetch properties before used in select, order, dedup, group, join, and apply. |
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 you explain more about how to process late project. Use some examples?
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.
More comment with examples added.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2451 +/- ##
===========================================
- Coverage 73.22% 39.95% -33.27%
===========================================
Files 88 88
Lines 9769 9769
===========================================
- Hits 7153 3903 -3250
- Misses 2616 5866 +3250
Continue to review full report at Codecov.
|
other_params.is_all_columns = false; | ||
// Fetch properties before used in Project, Select, Order, Dedup, Group, Join, and Apply. | ||
// e.g., | ||
// Case 1: For singe property (except used in Order or GroupVal), e.g., g.V().out().as("a").out().out().out().select("a").by("name"), |
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.
single
property. Can use chatgpt to help check typo fyi.
c2dddd9
to
b080b9e
Compare
b080b9e
to
32442a1
Compare
@@ -28,7 +28,7 @@ use ir_physical_client::physical_builder::{JobBuilder, Plan}; | |||
|
|||
use crate::error::{IrError, IrResult}; | |||
use crate::plan::logical::{LogicalPlan, NodeType}; | |||
use crate::plan::meta::PlanMeta; | |||
use crate::plan::meta::{ColumnsOpt, PlanMeta, TagId}; | |||
|
|||
/// A trait for building physical plan (pegasus) from the logical plan | |||
pub trait AsPhysical { |
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 should not be pegasus's JobBuilder
What do these changes do?
As titled.
Related issue number
Fixes #2460