Skip to content

Commit

Permalink
fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Sep 15, 2021
1 parent 35aa298 commit b3fac95
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 26 deletions.
1 change: 0 additions & 1 deletion src/graph/context/ast/QueryAstContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ struct FetchVerticesContext final : public AstContext {
bool distinct{false};
YieldColumns* yieldExpr{nullptr};
ExpressionProps exprProps;
std::vector<std::string> gvColNames;

// store the result of the previous sentence
std::string inputVarName;
Expand Down
1 change: 0 additions & 1 deletion src/graph/planner/ngql/FetchVerticesPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ StatusOr<SubPlan> FetchVerticesPlanner::transform(AstContext* astCtx) {
{},
fetchCtx_->distinct);
getVertices->setInputVar(vidsVar);
// getVertices->setColNames(fetchCtx_->gvColNames);

subPlan.root = Project::make(qctx, getVertices, fetchCtx_->yieldExpr);
if (fetchCtx_->distinct) {
Expand Down
6 changes: 4 additions & 2 deletions src/graph/validator/FetchVerticesValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ Status FetchVerticesValidator::validateYield(YieldClause *yield) {
auto typeStatus = deduceExprType(colExpr);
NG_RETURN_IF_ERROR(typeStatus);
outputs_.emplace_back(col->name(), typeStatus.value());
col->setAlias(col->name());
col->setExpr(rewriteIDVertex2Vid(colExpr));
if (colExpr->kind() == Expression::Kind::kFunctionCall) {
col->setAlias(col->name());
col->setExpr(rewriteIDVertex2Vid(colExpr));
}
newCols->addColumn(col->clone().release());

NG_RETURN_IF_ERROR(deduceProps(colExpr, exprProps));
Expand Down
1 change: 0 additions & 1 deletion src/graph/validator/test/FetchVerticesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class FetchVerticesValidatorTest : public ValidatorTestBase {
};

TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) {
// auto src = VariablePropertyExpression::make(pool_.get(), "_VARNAME_", "VertexID");
auto src = ColumnExpression::make(pool_.get(), 0);
{
auto qctx = getQCtx("FETCH PROP ON person \"1\"");
Expand Down
16 changes: 7 additions & 9 deletions tests/tck/features/fetch/FetchEmpty.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: Fetch prop on empty tag/edge
FETCH PROP ON * '1'
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
| ("1":zero_prop_tag_0:zero_prop_tag_1:person) |
And drop the used space

Expand All @@ -40,16 +40,15 @@ Feature: Fetch prop on empty tag/edge
FETCH PROP ON zero_prop_tag_0 '1'
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
| ("1":zero_prop_tag_0) |
When executing query:
"""
GO FROM "1" OVER zero_prop_edge
YIELD zero_prop_edge._dst as id
| FETCH PROP ON zero_prop_tag_0 $-.id
GO FROM "1" OVER zero_prop_edge YIELD zero_prop_edge._dst as id |
FETCH PROP ON zero_prop_tag_0 $-.id
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
| ("2":zero_prop_tag_0) |
And drop the used space

Expand All @@ -75,9 +74,8 @@ Feature: Fetch prop on empty tag/edge
| edges_ |
When executing query:
"""
GO FROM "1" OVER zero_prop_edge
YIELD zero_prop_edge._src as src, zero_prop_edge._dst as dst
| FETCH PROP ON zero_prop_edge $-.src->$-.dst
GO FROM "1" OVER zero_prop_edge YIELD zero_prop_edge._src as src, zero_prop_edge._dst as dst |
FETCH PROP ON zero_prop_edge $-.src->$-.dst
"""
Then the result should be, in any order:
| edges_ |
Expand Down
6 changes: 3 additions & 3 deletions tests/tck/features/fetch/FetchVertices.intVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,14 @@ Feature: Fetch Int Vid Vertices
"""
FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex)
"""
Then the result should be, in any order, and the columns 0 should be hashed:
Then the result should be, in any order, and the columns 0, 1 should be hashed:
| VertexID | id(VERTEX) |
| "Boris Diaw" | "Boris Diaw" |
When executing query:
"""
FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex), player.age
"""
Then the result should be, in any order, and the columns 0 should be hashed:
Then the result should be, in any order, and the columns 0, 1 should be hashed:
| VertexID | id(VERTEX) | player.age |
| "Boris Diaw" | "Boris Diaw" | 36 |
When executing query:
Expand Down Expand Up @@ -384,6 +384,6 @@ Feature: Fetch Int Vid Vertices
"""
FETCH PROP ON * hash('NON EXIST VERTEX ID'), hash('Boris Diaw') yield player.name, id(vertex)
"""
Then the result should be, in any order, and the columns 0 should be hashed:
Then the result should be, in any order, and the columns 0, 2 should be hashed:
| VertexID | player.name | id(VERTEX) |
| "Boris Diaw" | "Boris Diaw" | "Boris Diaw" |
8 changes: 4 additions & 4 deletions tests/tck/features/go/Orderby.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Feature: Orderby Sentence
| name | start | team |
When executing query:
"""
GO FROM "Marco Belinelli" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team
| YIELD $-.name as name WHERE $-.start > 20000
| ORDER BY $-.name
GO FROM "Marco Belinelli" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team |
YIELD $-.name as name WHERE $-.start > 20000 |
ORDER BY $-.name
"""
Then the result should be, in order, with relax comparison:
| name |
Expand Down Expand Up @@ -194,7 +194,7 @@ Feature: Orderby Sentence
$var = GO FROM "Tony Parker" OVER like YIELD like._dst AS dst; ORDER BY $var.dst DESC | FETCH PROP ON * $-.dst
"""
Then the result should be, in order, with relax comparison:
| vertices_ |
| VERTEX |
| ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) |
| ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) |
| ("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"}) |
Expand Down
6 changes: 3 additions & 3 deletions tests/tck/features/insert/Insert.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Feature: Insert string vid of vertex and edge
FETCH PROP ON * "Tom"
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
| ("Tom":person{name:"Tom", age:18}:interest{name:"basketball"}) |
# insert vertex wrong type value
When executing query:
Expand Down Expand Up @@ -147,7 +147,7 @@ Feature: Insert string vid of vertex and edge
FETCH PROP ON person "Conan"
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
| ('Conan') |
# insert vertex with string timestamp succeeded
When try to execute query:
Expand Down Expand Up @@ -508,7 +508,7 @@ Feature: Insert string vid of vertex and edge
FETCH PROP ON course "English"
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
| ('English') |
# check result
When executing query:
Expand Down
2 changes: 1 addition & 1 deletion tests/tck/features/mutate/InsertWithTimeType.feature
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Feature: Insert with time-dependent types
FETCH PROP ON tag_date "test";
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
When executing query:
"""
FETCH PROP ON edge_date "test_src"->"test_dst";
Expand Down
2 changes: 1 addition & 1 deletion tests/tck/features/ttl/TTL.feature
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Feature: TTLTest
FETCH PROP ON person "1";
"""
Then the result should be, in any order, with relax comparison:
| vertices_ |
| VERTEX |
When executing query:
"""
FETCH PROP ON person "1" YIELD person.id as id
Expand Down

0 comments on commit b3fac95

Please sign in to comment.