cwida / duckpgq-extension

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

Duplicate table index on query with any edge #60

Closed Dtenwolde closed 8 months ago

Dtenwolde commented 11 months ago

The following query fails with the following error: INTERNAL Error: Duplicate table index "1" found

Test from basic_match.test

query II
-SELECT study.a_name, study.b_name
FROM GRAPH_TABLE (pg
    MATCH
    (a:Person)-[k:Knows]-(b:Person)
    WHERE a.name = 'Peter'
    COLUMNS (a.name as a_name, b.name as b_name)
    ) study
    ORDER BY a_name, b_name;
----
Peter   Daniel
Peter   David
Peter   Gabor
Peter   Tavneet

Asked for clarification in Discord https://discord.com/channels/909674491309850675/921100573732909107/1182348485442404503

Following query reproduces the same results but does not run into this issue:

query II
select study.a_name, study.b_name from
    (SELECT DISTINCT a."name" AS a_name, b."name" AS b_name
        FROM know AS k , Student AS b , Student AS a
        WHERE ((((a.id = k.src) AND (b.id = k.dst)) OR ((a.id = k.dst) AND (b.id = k.src)))
        AND (a."name" = 'Peter')))
    AS study
    ORDER BY a_name, b_name;
----
Peter   Daniel
Peter   David
Peter   Gabor
Peter   Tavneet

Disabling the optimizer rule: OptimizerType::COMPRESSED_MATERIALIZATION stops the error from arising

Dtenwolde commented 9 months ago

Try again in version v0.10.*

Dtenwolde commented 9 months ago

Update after merge with v0.10.0 Same behaviour INTERNAL Error: Duplicate table index "1" found

Dtenwolde commented 8 months ago

Possibly related to #107