Skip to content

Commit

Permalink
Bug seems related to whether column in edge pattern is projected
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Mar 19, 2024
1 parent 58e0cd9 commit 71380fe
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions test/sql/pattern-matching/undirected_edges.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,45 @@ EDGE TABLES (
);

query II
SELECT a."name" AS person, b."name" AS friend
FROM ((SELECT know.src, know.dst, know.createDate FROM know) UNION ALL (SELECT know.dst, know.src, know.createDate FROM know)) AS k , Student AS b , Student AS a
WHERE ((a.id = k.src) AND (b.id = k.dst) AND (a."name" = 'Daniel'));
SELECT a.name AS person, b.name AS friend
FROM ((SELECT know.src, know.dst FROM know) UNION ALL (SELECT know.dst, know.src FROM know)) AS k , Student AS b , Student AS a
WHERE ((a.id = k.src) AND (b.id = k.dst) AND (a.name = 'Daniel'));
----
Daniel Tavneet
Daniel Gabor
Daniel Peter
Daniel David
Daniel Peter

# Daniel has 3 outgoing edges and 2 incoming edges, so there should be 5 tuples
#query III
#-FROM GRAPH_TABLE (pg
# MATCH
# (a:Student)-[k:know]-(b:Student)
# WHERE a.name = 'Daniel'
# COLUMNS (a.name as person, b.name as friend, k.createDate as date)
# )
#ORDER BY person, friend, date;
#----
#Daniel David 18
#Daniel Gabor 11
#Daniel Peter 12
#Daniel Peter 13
#Daniel Tavneet 10

# Daniel has 3 outgoing edges and 2 incoming edges, so there should be 5 tuples
query II
-FROM GRAPH_TABLE (pg
-SELECT person, friend, date
FROM GRAPH_TABLE (pg
MATCH
(a:Student)-[k:know]-(b:Student)
WHERE a.name = 'Daniel'
COLUMNS (a.name as person, b.name as friend)
);
COLUMNS (a.name as person, b.name as friend, k.createDate as date)
)
ORDER BY person, friend;
----
Daniel Tavneet
Daniel David
Daniel Gabor
Daniel Peter
Daniel David
Daniel Peter
Daniel Peter
Daniel Tavneet

0 comments on commit 71380fe

Please sign in to comment.