Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ REGRESS = scan \
name_validation \
jsonb_operators \
list_comprehension \
map_projection
map_projection \
unified_vertex_table

ifneq ($(EXTRA_TESTS),)
REGRESS += $(EXTRA_TESTS)
Expand Down
20 changes: 10 additions & 10 deletions regress/expected/age_global_graph.out
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ SELECT * FROM cypher('ag_graph_2', $$ MATCH (a:Person), (b:Person) WHERE a.name
SELECT * FROM cypher('ag_graph_1', $$ MATCH (n) RETURN vertex_stats(n) $$) AS (result agtype);
result
-----------------------------------------------------------------------------------------------
{"id": 844424930131969, "label": "vertex1", "in_degree": 0, "out_degree": 0, "self_loops": 0}
{"id": 281474976710657, "label": "", "in_degree": 0, "out_degree": 0, "self_loops": 0}
{"id": 281474976710658, "label": "", "in_degree": 0, "out_degree": 0, "self_loops": 0}
{"id": 844424930131969, "label": "vertex1", "in_degree": 0, "out_degree": 0, "self_loops": 0}
(3 rows)

--should return 1 vertice and 1 label
Expand Down Expand Up @@ -288,14 +288,14 @@ SELECT * FROM cypher('ag_graph_1', $$ MATCH (u)-[]->(v) MERGE (v)-[:stalks]->(u)
SELECT * FROM cypher('ag_graph_1', $$ MATCH (u)-[e]->(v) RETURN u, e, v $$) AS (u agtype, e agtype, v agtype);
u | e | v
--------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------
{"id": 281474976710660, "label": "", "properties": {"id": 281474976710660, "name": "v"}}::vertex | {"id": 1407374883553281, "label": "stalks", "end_id": 281474976710659, "start_id": 281474976710660, "properties": {}}::edge | {"id": 281474976710659, "label": "", "properties": {"id": 281474976710659, "name": "u"}}::vertex
{"id": 281474976710659, "label": "", "properties": {"id": 281474976710659, "name": "u"}}::vertex | {"id": 1125899906842625, "label": "knows", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge | {"id": 281474976710660, "label": "", "properties": {"id": 281474976710660, "name": "v"}}::vertex
{"id": 281474976710662, "label": "", "properties": {"id": 281474976710662, "name": "v"}}::vertex | {"id": 1407374883553282, "label": "stalks", "end_id": 281474976710661, "start_id": 281474976710662, "properties": {}}::edge | {"id": 281474976710661, "label": "", "properties": {"id": 281474976710661, "name": "u"}}::vertex
{"id": 281474976710661, "label": "", "properties": {"id": 281474976710661, "name": "u"}}::vertex | {"id": 1125899906842626, "label": "knows", "end_id": 281474976710662, "start_id": 281474976710661, "properties": {}}::edge | {"id": 281474976710662, "label": "", "properties": {"id": 281474976710662, "name": "v"}}::vertex
{"id": 281474976710664, "label": "", "properties": {"id": 281474976710664, "name": "v"}}::vertex | {"id": 1407374883553283, "label": "stalks", "end_id": 281474976710663, "start_id": 281474976710664, "properties": {}}::edge | {"id": 281474976710663, "label": "", "properties": {"id": 281474976710663, "name": "u"}}::vertex
{"id": 281474976710663, "label": "", "properties": {"id": 281474976710663, "name": "u"}}::vertex | {"id": 1125899906842627, "label": "knows", "end_id": 281474976710664, "start_id": 281474976710663, "properties": {}}::edge | {"id": 281474976710664, "label": "", "properties": {"id": 281474976710664, "name": "v"}}::vertex
{"id": 281474976710666, "label": "", "properties": {"id": 281474976710666, "name": "v"}}::vertex | {"id": 1407374883553284, "label": "stalks", "end_id": 281474976710665, "start_id": 281474976710666, "properties": {}}::edge | {"id": 281474976710665, "label": "", "properties": {"id": 281474976710665, "name": "u"}}::vertex
{"id": 281474976710665, "label": "", "properties": {"id": 281474976710665, "name": "u"}}::vertex | {"id": 1125899906842628, "label": "knows", "end_id": 281474976710666, "start_id": 281474976710665, "properties": {}}::edge | {"id": 281474976710666, "label": "", "properties": {"id": 281474976710666, "name": "v"}}::vertex
{"id": 281474976710662, "label": "", "properties": {"id": 281474976710662, "name": "v"}}::vertex | {"id": 1407374883553281, "label": "stalks", "end_id": 281474976710661, "start_id": 281474976710662, "properties": {}}::edge | {"id": 281474976710661, "label": "", "properties": {"id": 281474976710661, "name": "u"}}::vertex
{"id": 281474976710660, "label": "", "properties": {"id": 281474976710660, "name": "v"}}::vertex | {"id": 1407374883553282, "label": "stalks", "end_id": 281474976710659, "start_id": 281474976710660, "properties": {}}::edge | {"id": 281474976710659, "label": "", "properties": {"id": 281474976710659, "name": "u"}}::vertex
{"id": 281474976710664, "label": "", "properties": {"id": 281474976710664, "name": "v"}}::vertex | {"id": 1407374883553283, "label": "stalks", "end_id": 281474976710663, "start_id": 281474976710664, "properties": {}}::edge | {"id": 281474976710663, "label": "", "properties": {"id": 281474976710663, "name": "u"}}::vertex
{"id": 281474976710666, "label": "", "properties": {"id": 281474976710666, "name": "v"}}::vertex | {"id": 1407374883553284, "label": "stalks", "end_id": 281474976710665, "start_id": 281474976710666, "properties": {}}::edge | {"id": 281474976710665, "label": "", "properties": {"id": 281474976710665, "name": "u"}}::vertex
(8 rows)

-- what is there now?
Expand All @@ -306,7 +306,7 @@ SELECT * FROM cypher('ag_graph_1', $$ RETURN graph_stats('ag_graph_1') $$) AS (r
(1 row)

-- remove some vertices
SELECT * FROM ag_graph_1._ag_label_vertex;
SELECT id, properties FROM ag_graph_1._ag_label_vertex order by id;
id | properties
-----------------+--------------------------------------
281474976710657 | {}
Expand All @@ -325,7 +325,7 @@ SELECT * FROM ag_graph_1._ag_label_vertex;
DELETE FROM ag_graph_1._ag_label_vertex WHERE id::text = '281474976710661';
DELETE FROM ag_graph_1._ag_label_vertex WHERE id::text = '281474976710662';
DELETE FROM ag_graph_1._ag_label_vertex WHERE id::text = '281474976710664';
SELECT * FROM ag_graph_1._ag_label_vertex;
SELECT id, properties FROM ag_graph_1._ag_label_vertex order by id;
id | properties
-----------------+--------------------------------------
281474976710657 | {}
Expand All @@ -345,8 +345,8 @@ SELECT * FROM ag_graph_1._ag_label_edge;
1125899906842626 | 281474976710661 | 281474976710662 | {}
1125899906842627 | 281474976710663 | 281474976710664 | {}
1125899906842628 | 281474976710665 | 281474976710666 | {}
1407374883553281 | 281474976710660 | 281474976710659 | {}
1407374883553282 | 281474976710662 | 281474976710661 | {}
1407374883553281 | 281474976710662 | 281474976710661 | {}
1407374883553282 | 281474976710660 | 281474976710659 | {}
1407374883553283 | 281474976710664 | 281474976710663 | {}
1407374883553284 | 281474976710666 | 281474976710665 | {}
(8 rows)
Expand All @@ -357,7 +357,7 @@ WARNING: edge: [id: 1125899906842626, start: 281474976710661, end: 281474976710
WARNING: ignored malformed or dangling edge
WARNING: edge: [id: 1125899906842627, start: 281474976710663, end: 281474976710664, label: knows] end vertex not found
WARNING: ignored malformed or dangling edge
WARNING: edge: [id: 1407374883553282, start: 281474976710662, end: 281474976710661, label: stalks] start and end vertices not found
WARNING: edge: [id: 1407374883553281, start: 281474976710662, end: 281474976710661, label: stalks] start and end vertices not found
WARNING: ignored malformed or dangling edge
WARNING: edge: [id: 1407374883553283, start: 281474976710664, end: 281474976710663, label: stalks] start vertex not found
WARNING: ignored malformed or dangling edge
Expand Down
27 changes: 17 additions & 10 deletions regress/expected/age_load.out
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ WHERE table_schema = 'agload_test_graph' ORDER BY table_name ASC;
contrib_regression | agload_test_graph | has_city | BASE TABLE
(5 rows)

SELECT COUNT(*) FROM agload_test_graph."Country";
SELECT COUNT(*) FROM agload_test_graph._ag_label_vertex
WHERE labels = 'agload_test_graph."Country"'::regclass::oid;
count
-------
54
(1 row)

SELECT COUNT(*) FROM agload_test_graph."City";
SELECT COUNT(*) FROM agload_test_graph._ag_label_vertex
WHERE labels = 'agload_test_graph."City"'::regclass::oid;
count
-------
72485
Expand Down Expand Up @@ -194,19 +196,22 @@ SELECT load_labels_from_file('agload_test_graph', 'City2',

(1 row)

SELECT COUNT(*) FROM agload_test_graph."Country2";
SELECT COUNT(*) FROM agload_test_graph._ag_label_vertex
WHERE labels = 'agload_test_graph."Country2"'::regclass::oid;
count
-------
53
(1 row)

SELECT COUNT(*) FROM agload_test_graph."City2";
SELECT COUNT(*) FROM agload_test_graph._ag_label_vertex
WHERE labels = 'agload_test_graph."City2"'::regclass::oid;
count
-------
72485
(1 row)

SELECT id FROM agload_test_graph."Country" LIMIT 10;
SELECT id FROM agload_test_graph._ag_label_vertex
WHERE labels = 'agload_test_graph."Country"'::regclass::oid LIMIT 10;
id
-----------------
844424930131969
Expand All @@ -221,7 +226,8 @@ SELECT id FROM agload_test_graph."Country" LIMIT 10;
844424930132023
(10 rows)

SELECT id FROM agload_test_graph."Country2" LIMIT 10;
SELECT id FROM agload_test_graph._ag_label_vertex
WHERE labels = 'agload_test_graph."Country2"'::regclass::oid LIMIT 10;
id
------------------
1688849860263937
Expand All @@ -238,7 +244,7 @@ SELECT id FROM agload_test_graph."Country2" LIMIT 10;

-- Should return 2 rows for Country with same properties, but different ids
SELECT * FROM cypher('agload_test_graph', $$MATCH(n:Country {iso2 : 'BE'})
RETURN id(n), n.name, n.iso2 $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
RETURN id(n), n.name, n.iso2 ORDER BY id(n) $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
id(n) | n.name | n.iso2
-----------------+-----------+--------
844424930131990 | "Belgium" | "BE"
Expand All @@ -247,15 +253,15 @@ SELECT * FROM cypher('agload_test_graph', $$MATCH(n:Country {iso2 : 'BE'})

-- Should return 1 row
SELECT * FROM cypher('agload_test_graph', $$MATCH(n:Country2 {iso2 : 'BE'})
RETURN id(n), n.name, n.iso2 $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
RETURN id(n), n.name, n.iso2 ORDER BY id(n) $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
id(n) | n.name | n.iso2
------------------+-----------+--------
1688849860263942 | "Belgium" | "BE"
(1 row)

-- Should return 2 rows for Country with same properties, but different ids
SELECT * FROM cypher('agload_test_graph', $$MATCH(n:Country {iso2 : 'AT'})
RETURN id(n), n.name, n.iso2 $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
RETURN id(n), n.name, n.iso2 ORDER BY id(n) $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
id(n) | n.name | n.iso2
-----------------+-----------+--------
844424930131983 | "Austria" | "AT"
Expand All @@ -264,7 +270,7 @@ SELECT * FROM cypher('agload_test_graph', $$MATCH(n:Country {iso2 : 'AT'})

-- Should return 1 row
SELECT * FROM cypher('agload_test_graph', $$MATCH(n:Country2 {iso2 : 'AT'})
RETURN id(n), n.name, n.iso2 $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
RETURN id(n), n.name, n.iso2 ORDER BY id(n) $$) as ("id(n)" agtype, "n.name" agtype, "n.iso2" agtype);
id(n) | n.name | n.iso2
------------------+-----------+--------
1688849860263940 | "Austria" | "AT"
Expand All @@ -275,6 +281,7 @@ SELECT * FROM cypher('agload_test_graph', $$
MATCH (u:Country {region : "Europe"})
WHERE u.name =~ 'Cro.*'
RETURN id(u), u.name, u.region
ORDER BY id(u)
$$) AS ("id(u)" agtype, result_1 agtype, result_2 agtype);
id(u) | result_1 | result_2
-----------------+-----------+----------
Expand Down
44 changes: 23 additions & 21 deletions regress/expected/cypher_create.out
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ SELECT * FROM cypher_create.e;
1125899906842634 | 844424930131987 | 844424930131988 | {"id": "paths, edge two"}
(10 rows)

SELECT * FROM cypher_create.v;
SELECT id, properties FROM cypher_create._ag_label_vertex
WHERE labels = 'cypher_create.v'::regclass::oid;
id | properties
-----------------+------------------------------------
844424930131969 | {}
Expand Down Expand Up @@ -331,7 +332,8 @@ $$) as (a agtype);
---
(0 rows)

SELECT * FROM cypher_create.n_var;
SELECT id, properties FROM cypher_create._ag_label_vertex
WHERE labels = 'cypher_create.n_var'::regclass::oid;
id | properties
------------------+--------------------
1407374883553281 | {"name": "Node A"}
Expand Down Expand Up @@ -393,25 +395,6 @@ SELECT * FROM cypher('cypher_create', $$MATCH (n) RETURN n$$) AS (n agtype);
n
-------------------------------------------------------------------------------------------------
{"id": 281474976710657, "label": "", "properties": {}}::vertex
{"id": 281474976710658, "label": "", "properties": {}}::vertex
{"id": 281474976710659, "label": "", "properties": {}}::vertex
{"id": 281474976710660, "label": "", "properties": {}}::vertex
{"id": 281474976710661, "label": "", "properties": {}}::vertex
{"id": 281474976710662, "label": "", "properties": {}}::vertex
{"id": 281474976710663, "label": "", "properties": {}}::vertex
{"id": 281474976710664, "label": "", "properties": {}}::vertex
{"id": 281474976710665, "label": "", "properties": {}}::vertex
{"id": 281474976710666, "label": "", "properties": {}}::vertex
{"id": 281474976710667, "label": "", "properties": {}}::vertex
{"id": 281474976710668, "label": "", "properties": {}}::vertex
{"id": 281474976710669, "label": "", "properties": {}}::vertex
{"id": 281474976710670, "label": "", "properties": {}}::vertex
{"id": 281474976710671, "label": "", "properties": {}}::vertex
{"id": 281474976710672, "label": "", "properties": {}}::vertex
{"id": 281474976710673, "label": "", "properties": {}}::vertex
{"id": 281474976710674, "label": "", "properties": {"id": 0}}::vertex
{"id": 281474976710675, "label": "", "properties": {}}::vertex
{"id": 281474976710676, "label": "", "properties": {}}::vertex
{"id": 844424930131969, "label": "v", "properties": {}}::vertex
{"id": 844424930131970, "label": "v", "properties": {}}::vertex
{"id": 844424930131971, "label": "v", "properties": {"key": "value"}}::vertex
Expand All @@ -438,6 +421,25 @@ SELECT * FROM cypher('cypher_create', $$MATCH (n) RETURN n$$) AS (n agtype);
{"id": 1970324836974593, "label": "n_other_node", "properties": {}}::vertex
{"id": 1970324836974594, "label": "n_other_node", "properties": {}}::vertex
{"id": 1970324836974595, "label": "n_other_node", "properties": {}}::vertex
{"id": 281474976710658, "label": "", "properties": {}}::vertex
{"id": 281474976710659, "label": "", "properties": {}}::vertex
{"id": 281474976710660, "label": "", "properties": {}}::vertex
{"id": 281474976710661, "label": "", "properties": {}}::vertex
{"id": 281474976710662, "label": "", "properties": {}}::vertex
{"id": 281474976710663, "label": "", "properties": {}}::vertex
{"id": 281474976710664, "label": "", "properties": {}}::vertex
{"id": 281474976710665, "label": "", "properties": {}}::vertex
{"id": 281474976710666, "label": "", "properties": {}}::vertex
{"id": 281474976710667, "label": "", "properties": {}}::vertex
{"id": 281474976710668, "label": "", "properties": {}}::vertex
{"id": 281474976710669, "label": "", "properties": {}}::vertex
{"id": 281474976710670, "label": "", "properties": {}}::vertex
{"id": 281474976710671, "label": "", "properties": {}}::vertex
{"id": 281474976710672, "label": "", "properties": {}}::vertex
{"id": 281474976710673, "label": "", "properties": {}}::vertex
{"id": 281474976710674, "label": "", "properties": {"id": 0}}::vertex
{"id": 281474976710675, "label": "", "properties": {}}::vertex
{"id": 281474976710676, "label": "", "properties": {}}::vertex
(46 rows)

-- prepared statements
Expand Down
6 changes: 3 additions & 3 deletions regress/expected/cypher_delete.out
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ SELECT * FROM cypher('cypher_delete', $$MATCH p=()-[]->() RETURN p$$) AS (a agty
SELECT * FROM cypher('cypher_delete', $$MATCH(n) DELETE n RETURN n$$) AS (a agtype);
a
-----------------------------------------------------------------
{"id": 281474976710657, "label": "", "properties": {}}::vertex
{"id": 281474976710658, "label": "", "properties": {}}::vertex
{"id": 844424930132012, "label": "v", "properties": {}}::vertex
{"id": 281474976710657, "label": "", "properties": {}}::vertex
{"id": 844424930132013, "label": "v", "properties": {}}::vertex
{"id": 281474976710658, "label": "", "properties": {}}::vertex
(4 rows)

--Test 24
Expand Down Expand Up @@ -710,8 +710,8 @@ SELECT * FROM cypher('detach_delete', $$ MATCH ()-[e]->() RETURN e.name $$) as (
-------
"ab"
"cd"
"am"
"nm"
"am"
"pq"
(5 rows)

Expand Down
Loading