bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.34k stars 148 forks source link

Bugs with the unwind, collect keyword #645

Open w158937299 opened 8 months ago

w158937299 commented 8 months ago

Agensgraph version: 2.13.0 Operating system: (Windows 11) API/Driver: (psycopg2 2.9.7) Steps to reproduce 3 4

As shown in the first picture, query 1 unfolds the "p6" property values of nodes with outgoing relationships into separate rows. It can be observed that neo4j returns the correct results, while Agensgraph returns an empty set. Query 2 returns the "p6" property values of nodes with outgoing relationships, checking if the data retrieval is functioning properly. The results from neo4j and Agensgraph are consistent. Query 3 replaces the "unwind" keyword with "with" to check if other operators are causing the issue, and the results from neo4j and Agensgraph are also consistent. Therefore, we suspect that there may be a bug in Agensgraph when using the "unwind" keyword to unfold property values.
As shown in the second picture, query 1 first retrieves nodes with the label "nt3" and the property "p5" value 'Ce', then obtains nodes reached along the "et3" relationship from these nodes, and finally aggregates them into a list. Neo4j returns the correct results, while Agensgraph fails to retrieve the node's key-value pairs. Query 2, after removing the "collect" keyword, yields consistent results in both neo4j and Agensgraph. This bug is similar to the one in listing 8, so we suspect that Agensgraph may have a bug when using the "collect" keyword to gather nodes into a list.