Skip to content

Commit 37a5b16

Browse files
committed
Comment
1 parent da13616 commit 37a5b16

File tree

1 file changed

+11
-1
lines changed
  • lib/query-plan-executor/src

1 file changed

+11
-1
lines changed

lib/query-plan-executor/src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ impl ExecutablePlanNode for ParallelNode {
518518
number_of_indexes += 1;
519519
}
520520
}
521+
// We collect indexes in paths (replacing "@") to mutate the final result later
522+
// This is not a case for SequenceNode only for ParallelNode
523+
// Because in ParallelNode, we can't hold the mutable references
521524
let mut indexes_in_paths: Vec<VecDeque<usize>> = vec![];
522525
traverse_and_callback(
523526
data,
@@ -551,7 +554,10 @@ impl ExecutablePlanNode for ParallelNode {
551554
None,
552555
)
553556
}
554-
.unwrap_or(false);
557+
.unwrap_or_else(|e| {
558+
warn!("Error while projecting representations for FetchNode: {:?} {}", fetch_node, e);
559+
false
560+
});
555561
if is_projected {
556562
indexes_in_paths.push(indexes_in_path);
557563
}
@@ -593,6 +599,10 @@ impl ExecutablePlanNode for ParallelNode {
593599
}
594600
}
595601
ParallelJob::Flatten(mut result, path) => {
602+
/*
603+
* We iterate over the returned entities,
604+
* and merge them into the final response based on the path segments collected
605+
**/
596606
if let Some(entities) = result.entities {
597607
'entity_loop: for (entity, indexes_in_path) in
598608
entities.into_iter().zip(result.indexes_in_paths.iter_mut())

0 commit comments

Comments
 (0)