diff --git a/src/graph/executor/query/ExpandAllExecutor.cpp b/src/graph/executor/query/ExpandAllExecutor.cpp index dc675f0b09b..d434996f8b1 100644 --- a/src/graph/executor/query/ExpandAllExecutor.cpp +++ b/src/graph/executor/query/ExpandAllExecutor.cpp @@ -20,8 +20,8 @@ namespace graph { Status ExpandAllExecutor::buildRequestVids() { SCOPED_TIMER(&execTime_); const auto& inputVar = expand_->inputVar(); - auto inputIter = ectx_->getResult(inputVar).iterRef(); - auto iter = static_cast(inputIter); + auto inputIter = ectx_->getResult(inputVar).iter(); + auto iter = static_cast(inputIter.get()); size_t iterSize = iter->size(); nextStepVids_.reserve(iterSize); if (joinInput_) { diff --git a/src/graph/executor/query/ExpandExecutor.cpp b/src/graph/executor/query/ExpandExecutor.cpp index 9ed91926f12..41caf331906 100644 --- a/src/graph/executor/query/ExpandExecutor.cpp +++ b/src/graph/executor/query/ExpandExecutor.cpp @@ -20,8 +20,8 @@ namespace graph { Status ExpandExecutor::buildRequestVids() { SCOPED_TIMER(&execTime_); const auto& inputVar = expand_->inputVar(); - auto inputIter = ectx_->getResult(inputVar).iterRef(); - auto iter = static_cast(inputIter); + auto inputIter = ectx_->getResult(inputVar).iter(); + auto iter = static_cast(inputIter.get()); size_t iterSize = iter->size(); nextStepVids_.reserve(iterSize); QueryExpressionContext ctx(ectx_); diff --git a/src/graph/executor/query/TraverseExecutor.cpp b/src/graph/executor/query/TraverseExecutor.cpp index 95ad17e27ed..218e41e54de 100644 --- a/src/graph/executor/query/TraverseExecutor.cpp +++ b/src/graph/executor/query/TraverseExecutor.cpp @@ -36,8 +36,8 @@ folly::Future TraverseExecutor::execute() { Status TraverseExecutor::buildRequestVids() { SCOPED_TIMER(&execTime_); const auto& inputVar = traverse_->inputVar(); - auto inputIter = ectx_->getResult(inputVar).iterRef(); - auto iter = static_cast(inputIter); + auto inputIter = ectx_->getResult(inputVar).iter(); + auto iter = static_cast(inputIter.get()); size_t iterSize = iter->size(); vids_.reserve(iterSize); auto* src = traverse_->src(); diff --git a/tests/tck/features/go/GO.feature b/tests/tck/features/go/GO.feature index cb0abc1099c..e58d9a57a4e 100644 --- a/tests/tck/features/go/GO.feature +++ b/tests/tck/features/go/GO.feature @@ -2050,3 +2050,18 @@ Feature: Go Sentence | "Grant Hill" | "Grant Hill" | | "Vince Carter" | "Vince Carter" | | "Yao Ming" | "Yao Ming" | + + Scenario: multiple statements refer to the same variable + When executing query: + """ + $m1= LOOKUP ON player WHERE player.name == 'Tim Duncan' YIELD id(vertex) AS vid; + $m2 = GO 2 TO 10 STEPS FROM $m1.vid OVER like YIELD distinct id($$) AS dst + INTERSECT + GO 4 TO 7 STEPS FROM $m1.vid OVER like REVERSELY YIELD distinct id($$) AS dst + """ + Then the result should be, in any order, with relax comparison: + | dst | + | "LaMarcus Aldridge" | + | "Tim Duncan" | + | "Manu Ginobili" | + | "Tony Parker" |