cwida / duckpgq-extension

DuckDB extension that adds support for SQL/PGQ
https://duckpgq.notion.site/b8ac652667964f958bfada1c3e53f1bb?v=3b47a8d44bdf4e0c8b503bf23f1b76f2
MIT License
72 stars 7 forks source link

Duplicate label found with undirected edges #134

Closed Dtenwolde closed 2 months ago

Dtenwolde commented 2 months ago

The query below will return a binder error stating that the alias kBC is duplicated. This seems incorrect and likely due to the undirected edges, translated to a subquery with a union:

(SELECT Person_knows_person.Person1Id, Person_knows_person.Person2Id, * 
        FROM Person_knows_person) 
       UNION ALL 
       (SELECT Person_knows_person.Person2Id, Person_knows_person.Person1Id, * 
        FROM Person_knows_person)
      ) AS kAB
FROM GRAPH_TABLE (snb_projected
      MATCH (personA:Person)-[kAB:Knows where kAB.creationDate BETWEEN '2012-10-04' AND '2013-01-16']-
      (personB:Person)-[kBC:Knows where kBC.creationDate BETWEEN '2012-10-04' AND '2013-01-16']-
      (personC:Person)-[kCA:Knows where kCA.creationDate BETWEEN '2012-10-04' AND '2013-01-16']
      -(personA:Person));

Binder Error: Duplicate alias "kBC" in query!

To reproduce: Load SNB1-projected| dataset, generate the property graph, run the query above (q11 from SNB BI)