Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multiple label #1785

Closed
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OBJS = src/backend/age.o \
src/backend/parser/cypher_parse_node.o \
src/backend/parser/cypher_parser.o \
src/backend/parser/cypher_transform_entity.o \
src/backend/parser/cypher_label_expr.o \
src/backend/utils/adt/age_graphid_ds.o \
src/backend/utils/adt/agtype.o \
src/backend/utils/adt/agtype_ext.o \
Expand Down Expand Up @@ -113,6 +114,7 @@ REGRESS = scan \
jsonb_operators \
list_comprehension \
map_projection \
multiple_label \
drop

srcdir=`pwd`
Expand Down
96 changes: 48 additions & 48 deletions regress/expected/age_global_graph.out

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions regress/expected/age_load.out
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ NOTICE: graph "agload_test_graph" has been created
(1 row)

SELECT * FROM cypher('agload_test_graph', $$CREATE (n:Country {__id__:1}) RETURN n$$) as (n agtype);
n
----------------------------------------------------------------------------------
{"id": 844424930131969, "label": "Country", "properties": {"__id__": 1}}::vertex
n
------------------------------------------------------------------------------------
{"id": 844424930131969, "label": ["Country"], "properties": {"__id__": 1}}::vertex
(1 row)

--
Expand Down
479 changes: 321 additions & 158 deletions regress/expected/agtype.out

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions regress/expected/analyze.out
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NOTICE: graph "analyze" has been created
SELECT * FROM cypher('analyze', $$ CREATE (u) RETURN u $$) AS (result agtype);
result
----------------------------------------------------------------
{"id": 281474976710657, "label": "", "properties": {}}::vertex
{"id": 281474976710657, "label": [], "properties": {}}::vertex
(1 row)

-- should error due to invalid input to cypher function
Expand Down Expand Up @@ -100,7 +100,7 @@ SELECT * FROM age_prepare_cypher('analyze', 'MATCH (u) RETURN (u)');
SELECT * FROM cypher(NULL, NULL) AS (result agtype);
result
----------------------------------------------------------------
{"id": 281474976710657, "label": "", "properties": {}}::vertex
{"id": 281474976710657, "label": [], "properties": {}}::vertex
(1 row)

-- should error due to invalid input to cypher function
Expand Down
30 changes: 15 additions & 15 deletions regress/expected/cypher.out
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ CREATE TABLE my_detailed_paths AS
SELECT * FROM my_vertices;
u
----------------------------------------------------------------
{"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": 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
(10 rows)

SELECT * FROM my_edges;
Expand All @@ -198,11 +198,11 @@ SELECT * FROM my_edges;
SELECT * FROM my_detailed_paths;
u | e | v | p
----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"id": 281474976710657, "label": "", "properties": {}}::vertex | {"id": 844424930131969, "label": "knows", "end_id": 281474976710658, "start_id": 281474976710657, "properties": {}}::edge | {"id": 281474976710658, "label": "", "properties": {}}::vertex | [{"id": 281474976710657, "label": "", "properties": {}}::vertex, {"id": 844424930131969, "label": "knows", "end_id": 281474976710658, "start_id": 281474976710657, "properties": {}}::edge, {"id": 281474976710658, "label": "", "properties": {}}::vertex]::path
{"id": 281474976710659, "label": "", "properties": {}}::vertex | {"id": 844424930131970, "label": "knows", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge | {"id": 281474976710660, "label": "", "properties": {}}::vertex | [{"id": 281474976710659, "label": "", "properties": {}}::vertex, {"id": 844424930131970, "label": "knows", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge, {"id": 281474976710660, "label": "", "properties": {}}::vertex]::path
{"id": 281474976710661, "label": "", "properties": {}}::vertex | {"id": 844424930131971, "label": "knows", "end_id": 281474976710662, "start_id": 281474976710661, "properties": {}}::edge | {"id": 281474976710662, "label": "", "properties": {}}::vertex | [{"id": 281474976710661, "label": "", "properties": {}}::vertex, {"id": 844424930131971, "label": "knows", "end_id": 281474976710662, "start_id": 281474976710661, "properties": {}}::edge, {"id": 281474976710662, "label": "", "properties": {}}::vertex]::path
{"id": 281474976710663, "label": "", "properties": {}}::vertex | {"id": 844424930131972, "label": "knows", "end_id": 281474976710664, "start_id": 281474976710663, "properties": {}}::edge | {"id": 281474976710664, "label": "", "properties": {}}::vertex | [{"id": 281474976710663, "label": "", "properties": {}}::vertex, {"id": 844424930131972, "label": "knows", "end_id": 281474976710664, "start_id": 281474976710663, "properties": {}}::edge, {"id": 281474976710664, "label": "", "properties": {}}::vertex]::path
{"id": 281474976710665, "label": "", "properties": {}}::vertex | {"id": 844424930131973, "label": "knows", "end_id": 281474976710666, "start_id": 281474976710665, "properties": {}}::edge | {"id": 281474976710666, "label": "", "properties": {}}::vertex | [{"id": 281474976710665, "label": "", "properties": {}}::vertex, {"id": 844424930131973, "label": "knows", "end_id": 281474976710666, "start_id": 281474976710665, "properties": {}}::edge, {"id": 281474976710666, "label": "", "properties": {}}::vertex]::path
{"id": 281474976710657, "label": [], "properties": {}}::vertex | {"id": 844424930131969, "label": "knows", "end_id": 281474976710658, "start_id": 281474976710657, "properties": {}}::edge | {"id": 281474976710658, "label": [], "properties": {}}::vertex | [{"id": 281474976710657, "label": [], "properties": {}}::vertex, {"id": 844424930131969, "label": "knows", "end_id": 281474976710658, "start_id": 281474976710657, "properties": {}}::edge, {"id": 281474976710658, "label": [], "properties": {}}::vertex]::path
{"id": 281474976710659, "label": [], "properties": {}}::vertex | {"id": 844424930131970, "label": "knows", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge | {"id": 281474976710660, "label": [], "properties": {}}::vertex | [{"id": 281474976710659, "label": [], "properties": {}}::vertex, {"id": 844424930131970, "label": "knows", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge, {"id": 281474976710660, "label": [], "properties": {}}::vertex]::path
{"id": 281474976710661, "label": [], "properties": {}}::vertex | {"id": 844424930131971, "label": "knows", "end_id": 281474976710662, "start_id": 281474976710661, "properties": {}}::edge | {"id": 281474976710662, "label": [], "properties": {}}::vertex | [{"id": 281474976710661, "label": [], "properties": {}}::vertex, {"id": 844424930131971, "label": "knows", "end_id": 281474976710662, "start_id": 281474976710661, "properties": {}}::edge, {"id": 281474976710662, "label": [], "properties": {}}::vertex]::path
{"id": 281474976710663, "label": [], "properties": {}}::vertex | {"id": 844424930131972, "label": "knows", "end_id": 281474976710664, "start_id": 281474976710663, "properties": {}}::edge | {"id": 281474976710664, "label": [], "properties": {}}::vertex | [{"id": 281474976710663, "label": [], "properties": {}}::vertex, {"id": 844424930131972, "label": "knows", "end_id": 281474976710664, "start_id": 281474976710663, "properties": {}}::edge, {"id": 281474976710664, "label": [], "properties": {}}::vertex]::path
{"id": 281474976710665, "label": [], "properties": {}}::vertex | {"id": 844424930131973, "label": "knows", "end_id": 281474976710666, "start_id": 281474976710665, "properties": {}}::edge | {"id": 281474976710666, "label": [], "properties": {}}::vertex | [{"id": 281474976710665, "label": [], "properties": {}}::vertex, {"id": 844424930131973, "label": "knows", "end_id": 281474976710666, "start_id": 281474976710665, "properties": {}}::edge, {"id": 281474976710666, "label": [], "properties": {}}::vertex]::path
(5 rows)

-- cleanup
Expand Down
16 changes: 8 additions & 8 deletions regress/expected/cypher_call.out
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ HINT: Name explicitly using `YIELD` instead
SELECT * FROM cypher('cypher_call', $$ MATCH (a) CALL sqrt(64) YIELD sqrt RETURN a, sqrt $$) as (a agtype, sqrt agtype);
a | sqrt
------------------------------------------------------------------------+------
{"id": 281474976710657, "label": "", "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": "", "properties": {"n": "b"}}::vertex | 8.0
{"id": 281474976710657, "label": [], "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": [], "properties": {"n": "b"}}::vertex | 8.0
(2 rows)

/* MATCH CALL YIELD WHERE UPDATE/RETURN */
Expand All @@ -163,8 +163,8 @@ SELECT * FROM cypher('cypher_call', $$ MATCH (a) CALL sqrt(64) YIELD sqrt WHERE
SELECT * FROM cypher('cypher_call', $$ MATCH (a) CALL sqrt(64) YIELD sqrt WHERE sqrt = 8 RETURN a, sqrt $$) as (a agtype, sqrt agtype);
a | sqrt
------------------------------------------------------------------------+------
{"id": 281474976710657, "label": "", "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": "", "properties": {"n": "b"}}::vertex | 8.0
{"id": 281474976710657, "label": [], "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": [], "properties": {"n": "b"}}::vertex | 8.0
(2 rows)

SELECT * FROM cypher('cypher_call', $$ MATCH (a) CALL sqrt(64) YIELD sqrt WHERE b = 8 RETURN a, sqrt $$) as (a agtype, sqrt agtype);
Expand Down Expand Up @@ -195,15 +195,15 @@ SELECT * FROM cypher('cypher_call', $$ CALL sqrt(64) YIELD sqrt MATCH (a) WHERE
SELECT * FROM cypher('cypher_call', $$ CALL sqrt(64) YIELD sqrt MATCH (a) WHERE sqrt = 8 RETURN a, sqrt $$) as (a agtype, sqrt agtype);
a | sqrt
------------------------------------------------------------------------+------
{"id": 281474976710657, "label": "", "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": "", "properties": {"n": "b"}}::vertex | 8.0
{"id": 281474976710657, "label": [], "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": [], "properties": {"n": "b"}}::vertex | 8.0
(2 rows)

SELECT * FROM cypher('cypher_call', $$ CALL sqrt(64) YIELD sqrt WHERE sqrt = 8 MATCH (a) RETURN a, sqrt $$) as (a agtype, sqrt agtype);
a | sqrt
------------------------------------------------------------------------+------
{"id": 281474976710657, "label": "", "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": "", "properties": {"n": "b"}}::vertex | 8.0
{"id": 281474976710657, "label": [], "properties": {"n": "a"}}::vertex | 8.0
{"id": 281474976710658, "label": [], "properties": {"n": "b"}}::vertex | 8.0
(2 rows)

/* Multiple Calls: CALL YIELD CALL YIELD... RETURN */
Expand Down
Loading