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

Properties Not Created Correctly in Cypher Query Execution #2146

Open
levin-kitty opened this issue Jan 15, 2025 · 1 comment
Open

Properties Not Created Correctly in Cypher Query Execution #2146

levin-kitty opened this issue Jan 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@levin-kitty
Copy link

Hello, the Cypher query below is not working as expected.

SELECT * FROM ag_catalog.cypher('movie', $$
MERGE (m:Movie {name:"Top Gun", runtime: 120})
WITH m
UNWIND ["Tom Cruise", "Val Kilmer", "Anthony Edwards", "Meg Ryan"] AS actor
MERGE (a:Actor {name:actor})
MERGE (a)-[:ACTED_IN]->(m)
$$) as (v ag_catalog.agtype);

SELECT * FROM cypher('movie', $$
MATCH (a: Actor)
RETURN a
$$) as (a agtype);
                                  a
----------------------------------------------------------------------
 {"id": 1125899906842625, "label": "Actor", "properties": {}}::vertex
 {"id": 1125899906842626, "label": "Actor", "properties": {}}::vertex
 {"id": 1125899906842627, "label": "Actor", "properties": {}}::vertex
 {"id": 1125899906842628, "label": "Actor", "properties": {}}::vertex

As you can see, the property of the Actor was not created correctly.
However, when executed in Neo4j, the property was created successfully.

@levin-kitty levin-kitty added the bug Something isn't working label Jan 15, 2025
@MuhammadTahaNaveed
Copy link
Member

MuhammadTahaNaveed commented Jan 18, 2025

@levin-kitty I am unable to reproduce the issue on master.

issue_2146=# SELECT * FROM cypher('movie', $$
MERGE (m:Movie {name:"Top Gun", runtime: 120})
WITH m
UNWIND ["Tom Cruise", "Val Kilmer", "Anthony Edwards", "Meg Ryan"] AS actor
MERGE (a:Actor {name:actor})
MERGE (a)-[:ACTED_IN]->(m)
$$) as (v agtype);
 v 
---
(0 rows)

issue_2146=# SELECT * FROM cypher('movie', $$
MATCH p=(a)-[:ACTED_IN]->(m) return p
$$) as (v agtype);
                                                                                                                                                                      v                       
                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
 [{"id": 844424930131973, "label": "Actor", "properties": {"name": "Tom Cruise"}}::vertex, {"id": 1407374883553281, "label": "ACTED_IN", "end_id": 1125899906842625, "start_id": 8444249301319
73, "properties": {}}::edge, {"id": 1125899906842625, "label": "Movie", "properties": {"name": "Top Gun", "runtime": 120}}::vertex]::path
 [{"id": 844424930131974, "label": "Actor", "properties": {"name": "Val Kilmer"}}::vertex, {"id": 1407374883553282, "label": "ACTED_IN", "end_id": 1125899906842625, "start_id": 8444249301319
74, "properties": {}}::edge, {"id": 1125899906842625, "label": "Movie", "properties": {"name": "Top Gun", "runtime": 120}}::vertex]::path
 [{"id": 844424930131975, "label": "Actor", "properties": {"name": "Anthony Edwards"}}::vertex, {"id": 1407374883553283, "label": "ACTED_IN", "end_id": 1125899906842625, "start_id": 84442493
0131975, "properties": {}}::edge, {"id": 1125899906842625, "label": "Movie", "properties": {"name": "Top Gun", "runtime": 120}}::vertex]::path
 [{"id": 844424930131976, "label": "Actor", "properties": {"name": "Meg Ryan"}}::vertex, {"id": 1407374883553284, "label": "ACTED_IN", "end_id": 1125899906842625, "start_id": 844424930131976
, "properties": {}}::edge, {"id": 1125899906842625, "label": "Movie", "properties": {"name": "Top Gun", "runtime": 120}}::vertex]::path
(4 rows)

issue_2146=# SELECT * FROM cypher('movie', $$
issue_2146$# MATCH (a: Actor)
issue_2146$# RETURN a
issue_2146$# $$) as (a agtype);
                                              a                                               
----------------------------------------------------------------------------------------------
 {"id": 844424930131969, "label": "Actor", "properties": {}}::vertex
 {"id": 844424930131970, "label": "Actor", "properties": {}}::vertex
 {"id": 844424930131971, "label": "Actor", "properties": {}}::vertex
 {"id": 844424930131972, "label": "Actor", "properties": {}}::vertex
 {"id": 844424930131973, "label": "Actor", "properties": {"name": "Tom Cruise"}}::vertex
 {"id": 844424930131974, "label": "Actor", "properties": {"name": "Val Kilmer"}}::vertex
 {"id": 844424930131975, "label": "Actor", "properties": {"name": "Anthony Edwards"}}::vertex
 {"id": 844424930131976, "label": "Actor", "properties": {"name": "Meg Ryan"}}::vertex
(8 rows)

Please share the following info

  • AGE version
  • PostgreSQL version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants