From ae423ac00829cc63c9bdcfa52e857ea58589a9d3 Mon Sep 17 00:00:00 2001 From: laura-ding <48548375+laura-ding@users.noreply.github.com> Date: Tue, 20 Jul 2021 15:46:08 +0800 Subject: [PATCH] Fix the go return bad_type when the vertex without the tag (#1273) Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> --- src/context/Iterator.cpp | 3 +++ tests/tck/features/go/GO.feature | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/context/Iterator.cpp b/src/context/Iterator.cpp index 9fc92de07..344849276 100644 --- a/src/context/Iterator.cpp +++ b/src/context/Iterator.cpp @@ -298,6 +298,9 @@ const Value& GetNeighborsIter::getTagProp(const std::string& tag, auto colId = index->second.colIdx; auto& row = *currentRow_; DCHECK_GT(row.size(), colId); + if (row[colId].empty()) { + return Value::kEmpty; + } if (!row[colId].isList()) { return Value::kNullBadType; } diff --git a/tests/tck/features/go/GO.feature b/tests/tck/features/go/GO.feature index c930d225b..58d39f289 100644 --- a/tests/tck/features/go/GO.feature +++ b/tests/tck/features/go/GO.feature @@ -1821,3 +1821,14 @@ Feature: Go Sentence """ Then the result should be, in any order, with relax comparison: | like._dst | + + Scenario: with no existed tag + When executing query: + """ + GO FROM 'Tony Parker' OVER like YIELD $$.player.name, $^.team.name + """ + Then the result should be, in any order, with relax comparison: + | $$.player.name | $^.team.name | + | "LaMarcus Aldridge" | EMPTY | + | "Manu Ginobili" | EMPTY | + | "Tim Duncan" | EMPTY |