Skip to content

Commit

Permalink
[BugFix] Fix bug in endV() after PathExpand (#2881)
Browse files Browse the repository at this point in the history
<!--
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
  • Loading branch information
BingqingLyu committed Jun 14, 2023
1 parent a18836d commit 17819c8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
8 changes: 5 additions & 3 deletions interactive_engine/executor/ir/runtime/src/assembly.rs
Expand Up @@ -613,9 +613,11 @@ impl<P: PartitionInfo, C: ClusterInfo> IRJobAssembly<P, C> {
})?;
}
}
// path end
let path_end_func = self.udf_gen.gen_path_end(path)?;
stream = stream.map_with_name("PathEnd", move |input| path_end_func.exec(input))?;
// path end to add path_alias if exists
if path.alias.is_some() {
let path_end_func = self.udf_gen.gen_path_end(path)?;
stream = stream.map_with_name("PathEnd", move |input| path_end_func.exec(input))?;
}
}
OpKind::Scan(scan) => {
let udf_gen = self.udf_gen.clone();
Expand Down
Expand Up @@ -71,18 +71,23 @@ impl FilterMapFunction<Record, Record> for GetVertexOperator {
} else {
Ok(None)
}
} else if let Some(_) = entry.as_graph_path() {
let graph_path = input
.get_mut(self.start_tag)
.unwrap()
.as_any_mut()
.downcast_mut::<GraphPath>()
.ok_or(FnExecError::unexpected_data_error(&format!("entry is not a path in GetV")))?;
} else if let Some(graph_path) = entry.as_graph_path() {
// we check VOpt here:
// 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)
// for `End`, we treat it as to get EndV() in the Path (in which case is getting the end vertex from the path)
match self.opt {
VOpt::Other => {
let graph_path = input
.get_mut(self.start_tag)
.ok_or(FnExecError::unexpected_data_error(&format!(
"get_mut of GraphPath failed in {:?}",
self
)))?
.as_any_mut()
.downcast_mut::<GraphPath>()
.ok_or(FnExecError::unexpected_data_error(&format!(
"entry is not a path in GetV"
)))?;
let path_end_edge = graph_path.get_path_end().as_edge().ok_or(
FnExecError::unexpected_data_error(&format!(
"GetOtherVertex on a path entry with input: {:?}",
Expand Down

0 comments on commit 17819c8

Please sign in to comment.