Skip to content

Commit

Permalink
fix fetch vertices & edges test error
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Oct 20, 2021
1 parent a1a2341 commit 45dd998
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 258 deletions.
39 changes: 19 additions & 20 deletions tests/tck/features/fetch/FetchEdges.intVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw') -> hash('Hawks') YIELD serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2003 | 2005 |
When executing query:
"""
FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks') YIELD serve.start_year > 2001, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| (serve.start_year>2001) | serve.end_year |
| True | 2005 |
# Fetch prop on an edge without yield
Expand All @@ -38,7 +38,7 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks')@0 YIELD serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2003 | 2005 |
# Fetch prop on a edge with a rank,but without yield
Expand All @@ -55,7 +55,7 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks'),hash('Boris Diaw')->hash('Suns') YIELD serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2003 | 2005 |
| 2005 | 2008 |
Expand All @@ -64,7 +64,7 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash("Zion Williamson")->hash("Spurs"), hash("Boris Diaw")->hash("Hawks") YIELD serve.start_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year |
| 2003 |

Expand All @@ -74,7 +74,7 @@ Feature: Fetch Int Vid Edges
GO FROM hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst |
FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2005 | 2008 |
| 2003 | 2005 |
Expand All @@ -88,7 +88,7 @@ Feature: Fetch Int Vid Edges
$var = GO FROM hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst;
FETCH PROP ON serve $var.src->$var.dst YIELD serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2005 | 2008 |
| 2003 | 2005 |
Expand Down Expand Up @@ -126,7 +126,7 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks'),hash('Boris Diaw')->hash('Hawks') YIELD DISTINCT serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2003 | 2005 |
# Fetch prop works with DISTINCT and pipeline
Expand All @@ -135,7 +135,7 @@ Feature: Fetch Int Vid Edges
GO FROM hash('Boris Diaw'),hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst |
FETCH PROP ON serve $-.src->$-.dst YIELD DISTINCT serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year |
| 2005 | 2008 |
| 2003 | 2005 |
Expand All @@ -147,18 +147,17 @@ Feature: Fetch Int Vid Edges
GO FROM hash('Tim Duncan'),hash('Tony Parker') OVER serve YIELD serve._src AS src, serve._dst AS dst |
FETCH PROP ON serve $-.src->$-.dst YIELD DISTINCT serve._dst as dst
"""
Then the result should be, in any order, and the columns 0,1,3 should be hashed:
Then the result should be, in any order, and the columns 0 should be hashed:
| dst |
| 'Spurs' |
| 'Spurs' |
| 'Hornets' |
# Fetch prop works with DISTINCT and user define variable
When executing query:
"""
$var = GO FROM hash('Boris Diaw'),hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst;
FETCH PROP ON serve $var.src->$var.dst YIELD DISTINCT serve.start_year, serve.end_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order, with relax comparison:
| serve.start_year | serve.end_year |
| 2005 | 2008 |
| 2003 | 2005 |
Expand Down Expand Up @@ -234,7 +233,7 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw')->hash("Spurs") YIELD serve.start_year, serve.start_year
"""
Then the result should be, in any order, and the columns 0,1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.start_year |
| 2012 | 2012 |

Expand All @@ -243,7 +242,7 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw')->hash("Spurs") YIELD serve._src, serve._dst, serve._rank
"""
Then the result should be, in any order, and the columns 0,1,3,4 should be hashed:
Then the result should be, in any order, and the columns 0,1 should be hashed:
| serve._src | serve._dst | serve._rank |
| "Boris Diaw" | "Spurs" | 0 |

Expand All @@ -252,36 +251,36 @@ Feature: Fetch Int Vid Edges
"""
FETCH PROP ON serve hash('Boris Diaw') -> hash('Hawks') YIELD serve.start_year, serve.end_year, edge as relationship
"""
Then the result should be, in any order, and the columns 0, 1 should be hashed:
Then the result should be, in any order:
| serve.start_year | serve.end_year | relationship |
| 2003 | 2005 | [:serve hash("Boris Diaw")->hash("Hawks") @0 {end_year: 2005, start_year: 2003}] |
When executing query:
"""
FETCH PROP ON serve hash("Boris Diaw")->hash("Spurs") YIELD edge as relationship, src(edge) as src_edge, dst(edge) as dst_edge, type(edge) as type, rank(edge) as rank
"""
Then the result should be, in any order, and the columns 0, 1, 4, 5 should be hashed:
Then the result should be, in any order, and the columns 1,2 should be hashed:
| relationship | src_edge | dst_edge | type | rank |
| [:serve hash("Boris Diaw")->hash("Spurs") @0 {end_year: 2016, start_year: 2012}] | "Boris Diaw" | "Spurs" | "serve" | 0 |
When executing query:
"""
FETCH PROP ON serve hash("Boris Diaw")->hash("Not Exist") YIELD src(edge) as a
"""
Then the result should be, in any order:
Then the result should be, in any order, with relax comparison:
| a |
When executing query:
"""
FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan"), hash("Grant Hill") -> hash("Tracy McGrady") YIELD edge as relationship |
YIELD properties($-.relationship)
"""
Then the result should be, in any order:
Then the result should be, in any order, with relax comparison:
| properties($-.relationship) |
| {likeness: 95} |
| {likeness: 90} |
When executing query:
"""
FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan"), hash("Grant Hill") -> hash("Tracy McGrady") YIELD properties(edge) as properties
"""
Then the result should be, in any order, and the columns 0, 1 should be hashed:
Then the result should be, in any order, with relax comparison:
| properties |
| {likeness: 95} |
| {likeness: 90} |
Expand All @@ -308,7 +307,7 @@ Feature: Fetch Int Vid Edges
$var = GO FROM hash('Boris Diaw'),hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst;
FETCH PROP ON serve $var.src->$var.dst YIELD DISTINCT serve.start_year, serve.end_year, edge as relationship
"""
Then the result should be, in any order, and the columns 0, 1 should be hashed:
Then the result should be, in any order, with relax comparison:
| serve.start_year | serve.end_year | relationship |
| 2005 | 2008 | [:serve hash("Boris Diaw")->hash("Suns") @0 {end_year: 2008, start_year: 2005}] |
| 2003 | 2005 | [:serve hash("Boris Diaw")->hash("Hawks") @0 {end_year: 2005, start_year: 2003}] |
Expand Down
19 changes: 9 additions & 10 deletions tests/tck/features/fetch/FetchEdges.strVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ Feature: Fetch String Vid Edges
Then the result should be, in any order:
| dst |
| 'Spurs' |
| 'Spurs' |
| 'Hornets' |
# Fetch prop works with DISTINCT and user define variable
When executing query:
Expand Down Expand Up @@ -201,26 +200,26 @@ Feature: Fetch String Vid Edges
Scenario: Fetch and Yield
When executing query:
"""
FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" |
YIELD properties($-.edges_)
FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as e |
YIELD properties($-.e)
"""
Then the result should be, in any order:
| properties($-.edges_) |
| {likeness: 95} |
| {likeness: 90} |
| properties($-.e) |
| {likeness: 95} |
| {likeness: 90} |
When executing query:
"""
FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" |
YIELD startNode($-.edges_) AS nodes
FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as e |
YIELD startNode($-.e) AS nodes
"""
Then the result should be, in any order, with relax comparison:
| nodes |
| ("Tony Parker") |
| ("Grant Hill") |
When executing query:
"""
FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" |
YIELD endNode($-.edges_) AS nodes
FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as e |
YIELD endNode($-.e) AS nodes
"""
Then the result should be, in any order, with relax comparison:
| nodes |
Expand Down
Loading

0 comments on commit 45dd998

Please sign in to comment.