Skip to content

Commit 17819c8

Browse files
authored
[BugFix] Fix bug in endV() after PathExpand (#2881)
<!-- Thanks for your contribution! please review https://github.com/alibaba/GraphScope/blob/main/CONTRIBUTING.md before opening an issue. --> ## What do these changes do? <!-- Please give a short brief about these changes. --> As titled. ## Related issue number <!-- Are there any issues opened that will be resolved by merging this change? --> Fixes #2880
1 parent a18836d commit 17819c8

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

interactive_engine/executor/ir/runtime/src/assembly.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,11 @@ impl<P: PartitionInfo, C: ClusterInfo> IRJobAssembly<P, C> {
613613
})?;
614614
}
615615
}
616-
// path end
617-
let path_end_func = self.udf_gen.gen_path_end(path)?;
618-
stream = stream.map_with_name("PathEnd", move |input| path_end_func.exec(input))?;
616+
// path end to add path_alias if exists
617+
if path.alias.is_some() {
618+
let path_end_func = self.udf_gen.gen_path_end(path)?;
619+
stream = stream.map_with_name("PathEnd", move |input| path_end_func.exec(input))?;
620+
}
619621
}
620622
OpKind::Scan(scan) => {
621623
let udf_gen = self.udf_gen.clone();

interactive_engine/executor/ir/runtime/src/process/operator/map/get_v.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,23 @@ impl FilterMapFunction<Record, Record> for GetVertexOperator {
7171
} else {
7272
Ok(None)
7373
}
74-
} else if let Some(_) = entry.as_graph_path() {
75-
let graph_path = input
76-
.get_mut(self.start_tag)
77-
.unwrap()
78-
.as_any_mut()
79-
.downcast_mut::<GraphPath>()
80-
.ok_or(FnExecError::unexpected_data_error(&format!("entry is not a path in GetV")))?;
74+
} else if let Some(graph_path) = entry.as_graph_path() {
8175
// we check VOpt here:
8276
// for `Other`, we treat it as to get_other_id() in the Edge within the Path (in which case is expanding the path with a adj vertex)
8377
// for `End`, we treat it as to get EndV() in the Path (in which case is getting the end vertex from the path)
8478
match self.opt {
8579
VOpt::Other => {
80+
let graph_path = input
81+
.get_mut(self.start_tag)
82+
.ok_or(FnExecError::unexpected_data_error(&format!(
83+
"get_mut of GraphPath failed in {:?}",
84+
self
85+
)))?
86+
.as_any_mut()
87+
.downcast_mut::<GraphPath>()
88+
.ok_or(FnExecError::unexpected_data_error(&format!(
89+
"entry is not a path in GetV"
90+
)))?;
8691
let path_end_edge = graph_path.get_path_end().as_edge().ok_or(
8792
FnExecError::unexpected_data_error(&format!(
8893
"GetOtherVertex on a path entry with input: {:?}",

0 commit comments

Comments
 (0)