Skip to content

Commit af2b61f

Browse files
authored
fix(interactive): support unbounded path expand (#4534)
`MATCH (message: POST | COMMENT)-[:REPLYOF*0..*]->(post:POST)-[:HASCREATOR]->(person:PERSON)`
1 parent bf8e310 commit af2b61f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flex/engines/graph_db/runtime/common/operators/retrieve/path_expand.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bl::result<Context> PathExpand::edge_expand_v(const GraphReadInterface& graph,
5353
output.emplace_back(label, v, index);
5454
});
5555
int depth = 0;
56-
while (depth < params.hop_upper) {
56+
while (depth < params.hop_upper && (!output.empty())) {
5757
input.clear();
5858
std::swap(input, output);
5959
if (depth >= params.hop_lower) {
@@ -116,7 +116,7 @@ bl::result<Context> PathExpand::edge_expand_v(const GraphReadInterface& graph,
116116
});
117117
}
118118
int depth = 0;
119-
while (depth < params.hop_upper) {
119+
while (depth < params.hop_upper && (!output.empty())) {
120120
input.clear();
121121
std::swap(input, output);
122122
if (depth >= params.hop_lower) {

0 commit comments

Comments
 (0)