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 23, 2021
1 parent 181bf72 commit 83f6450
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
7 changes: 0 additions & 7 deletions src/graph/validator/GetSubgraphValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ Status GetSubgraphValidator::validateImpl() {
NG_RETURN_IF_ERROR(validateOutBound(gsSentence->out()));
NG_RETURN_IF_ERROR(validateBothInOutBound(gsSentence->both()));
NG_RETURN_IF_ERROR(validateYield(gsSentence->yield()));
// set output col & type
if (subgraphCtx_->steps.steps() == 0) {
outputs_.emplace_back(kVertices, Value::Type::VERTEX);
} else {
outputs_.emplace_back(kVertices, Value::Type::VERTEX);
outputs_.emplace_back(kEdges, Value::Type::EDGE);
}
return Status::OK();
}

Expand Down
14 changes: 7 additions & 7 deletions tests/tck/features/bugfix/SubgraphBeforePipe.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature: Test get subgraph before pipe
| [:teammate "Tim Duncan"->"Manu Ginobili"@0] |
| [:teammate "Tim Duncan"->"Tony Parker"@0] |
Then the result should be, in any order, with relax comparison:
| _vertices | _edges |
| VERTEX | EDGE |
| [("Tim Duncan")] | <[edge1]> |

Scenario: subgraph as variable with limit
Expand Down Expand Up @@ -65,19 +65,19 @@ Feature: Test get subgraph before pipe
| [:teammate "Tim Duncan"->"Manu Ginobili"@0] |
| [:teammate "Tim Duncan"->"Tony Parker"@0] |
Then the result should be, in any order, with relax comparison:
| _vertices | _edges |
| VERTEX | EDGE |
| [("Tim Duncan")] | <[edge1]> |

# TODO: access to the output of get subgraph.
# Currently _vertices is a reserved keyword.
# Currently VERTEX is a reserved keyword.
#
# Scenario: two steps subgraph with limit
# When executing query:
# """
# (root@nebula) [nba]> $a = GET SUBGRAPH WITH PROP 3 STEPS FROM 'Paul George' OUT serve BOTH like | yield COUNT($a._vertices)
# (root@nebula) [nba]> $a = GET SUBGRAPH WITH PROP 3 STEPS FROM 'Paul George' OUT serve BOTH like | yield COUNT($a.VERTEX)
# """
# Then the result should be, in any order, with relax comparison:
# | COUNT($a._vertices) |
# | COUNT($a.VERTEX) |
# | 4 |
Scenario: two steps subgraph with limit
When executing query:
Expand Down Expand Up @@ -157,7 +157,7 @@ Feature: Test get subgraph before pipe
| | | [:serve "Tiago Splitter"->"76ers"@0] |
| | | [:serve "Tiago Splitter"->"Hawks"@0] |
Then the result should be, in any order, with relax comparison:
| _vertices | _edges |
| VERTEX | EDGE |
| [("Tim Duncan")] | <[edge1]> |
| <[vertex2]> | <[edge2]> |

Expand All @@ -173,7 +173,7 @@ Feature: Test get subgraph before pipe
| [:serve "Paul George"->"Thunders"@0] | [:serve "Russell Westbrook"->"Thunders"@0] |
| [:like "Paul George"->"Russell Westbrook"@0] | [:like "Russell Westbrook"->"James Harden"@0] |
Then the result should be, in any order, with relax comparison:
| _vertices | _edges |
| VERTEX | EDGE |
| [("Paul George")] | <[edge1]> |
| [("Russell Westbrook"), ("Pacers"), ("Thunders")] | <[edge2]> |
When executing query:
Expand Down
2 changes: 1 addition & 1 deletion tests/tck/features/subgraph/subgraph.IntVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: Integer Vid subgraph
Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD vertex OR edge
When executing query:
"""
GET SUBGRAPH 0 STEPS WITH PROP FROM hash("Tim Duncan") YIELD edge
GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan") YIELD edge
"""
Then a SemanticError should be raised at runtime: Get Subgraph 0 STEPS only support YIELD vertex
When executing query:
Expand Down
3 changes: 2 additions & 1 deletion tests/tck/features/subgraph/subgraph.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
@jmq
Feature: subgraph

Background:
Expand Down Expand Up @@ -30,7 +31,7 @@ Feature: subgraph
Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD vertex OR edge
When executing query:
"""
GET SUBGRAPH 0 STEPS WITH PROP FROM "Tim Duncan" YIELD edge
GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan" YIELD edge
"""
Then a SemanticError should be raised at runtime: Get Subgraph 0 STEPS only support YIELD vertex
When executing query:
Expand Down

0 comments on commit 83f6450

Please sign in to comment.