YGY-001 opened a new issue, #2612:
URL: https://github.com/apache/age/issues/2612

    
   
   ## Environment
   
   - Apache AGE 1.8.0
   - PostgreSQL 18.6
   - Docker image: apache/age:release_PG18_1.8.0
   - Execute the SQL directly with psql.
   
   ## Setup
   
   ~~~sql
   LOAD 'age';
   SET search_path = ag_catalog, public;
   
   SELECT ag_catalog.create_graph('issue42_left');
   SELECT ag_catalog.create_graph('issue42_right');
   
   -- LEFT graph: target is created before decoy.
   SELECT *
   FROM ag_catalog.cypher('issue42_left', $$
   CREATE (s:L {role: 'source'})-[:R {k0: false, k6: true}]->
          (t {role: 'target', value: 129}), (d {role: 'decoy'})
   $$) AS (result agtype);
   
   -- RIGHT graph: the same vertices and edge are created in a different order.
   SELECT *
   FROM ag_catalog.cypher('issue42_right', $$
   CREATE (d {role: 'decoy'}),
          (s:L {role: 'source'})-[:R {k0: false, k6: true}]->
          (t {role: 'target', value: 129})
   $$) AS (result agtype);
   ~~~
   
   The role and edge mapping is source -> source, target -> target,
   decoy -> decoy, and edge(source,target) -> edge(source,target). Both graphs
   have the same labels, properties, and topology. Their target IDs differ:
   281474976710657 on LEFT and 281474976710658 on RIGHT.
   
   ## LEFT graph / LEFT query
   
   Run the direct query on issue42_left:
   
   ~~~sql
   SELECT *
   FROM ag_catalog.cypher('issue42_left', $$
   MATCH (s:L {role: 'source'})-[r0:R]->(t)
   WHERE t.role = 'target'
   WITH r0
   WITH r0.k6 AS alias0, r0.k0 AS alias1, endNode(r0) AS alias2, r0
   ORDER BY alias0 DESC, alias1 ASC
   WITH alias0, alias1, alias2, r0
   RETURN alias0, alias1, id(alias2) AS endpoint_id,
          labels(alias2) AS endpoint_labels,
          properties(alias2) AS endpoint_properties, alias2, r0
   $$) AS (alias0 agtype, alias1 agtype, endpoint_id agtype,
           endpoint_labels agtype, endpoint_properties agtype,
           alias2 agtype, r0 agtype);
   ~~~
   
   ## RIGHT graph / RIGHT query
   
   Run the barrier-equivalent pure-Cypher continuation on issue42_right. The two
   OPTIONAL MATCH clauses rebind the relationship and endpoint by ID at the
   barrier boundaries:
   
   ~~~sql
   SELECT *
   FROM ag_catalog.cypher('issue42_right', $$
   MATCH (s:L {role: 'source'})-[r0:R]->(t)
   WHERE t.role = 'target'
   WITH r0
   OPTIONAL MATCH ()-[r1:R]->()
   WHERE r1 IS NOT NULL AND id(r1) = id(r0)
   WITH r1 AS r0
   WITH r0.k6 AS alias0, r0.k0 AS alias1, endNode(r0) AS alias2, r0
   ORDER BY alias0 DESC, alias1 ASC
   WITH alias0, alias1, alias2, r0
   OPTIONAL MATCH (rebound)
   WHERE alias2 IS NOT NULL AND id(rebound) = id(alias2)
   OPTIONAL MATCH ()-[r2:R]->()
   WHERE r0 IS NOT NULL AND id(r2) = id(r0)
   WITH alias0, alias1, rebound AS alias2, r2 AS r0
   RETURN alias0, alias1, id(alias2) AS endpoint_id,
          labels(alias2) AS endpoint_labels,
          properties(alias2) AS endpoint_properties, alias2, r0
   $$) AS (alias0 agtype, alias1 agtype, endpoint_id agtype,
           endpoint_labels agtype, endpoint_properties agtype,
           alias2 agtype, r0 agtype);
   ~~~
   
   ## Expected and actual
   
   The RIGHT query rebinds the same role-mapped endpoint as the LEFT query.
   After mapping graph IDs by role, the endpoint identity, properties, row 
count,
   and graph topology should agree, including endpoint_labels.
   
   AGE 1.8.0 returns one row on each side. The endpoint properties agree, but 
the
   labels differ:
   
   ~~~text
   LEFT:  endpoint_id=281474976710657
          endpoint_labels=["_ag_label_vertex"]
          endpoint_properties={"role":"target","value":129}
   
   RIGHT: endpoint_id=281474976710658
          endpoint_labels=[""]
          endpoint_properties={"role":"target","value":129}
   ~~~
   
   The different IDs map to the same target role in the two isomorphic graphs.
   
    
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to