Skip to content

Commit

Permalink
fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Aug 31, 2021
1 parent 92d7aef commit 3990d70
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 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 @@ -130,7 +130,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" |

0 comments on commit 3990d70

Please sign in to comment.