Skip to content
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

[BugFix] Fix bug in endV() after PathExpand #2881

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions interactive_engine/executor/ir/runtime/src/assembly.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading