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

Seg fault when doing TopK queries #46

Closed Dtenwolde closed 1 month ago

Dtenwolde commented 1 year ago

The following query results in a seg fault:

-FROM GRAPH_TABLE (pg
    MATCH
    p = ANY SHORTEST 5 WALK (a:Person)-[k:knows]-> *(b:Person)
    WHERE a.name = 'Daniel'
    COLUMNS (p, a.name as name, b.name as school)
    ) study;

Should for now give a 'Not implemented Error: TopK has not been implemented yet.'

Seems to go wrong here: PGSubPath p = (PGSubPath ) lfirst(list_head(l)); (https://github.com/cwida/duckdb-pgq/blob/fd44771959318ba55f4c19bfb6a9fe64e5434a73/third_party/libpg_query/grammar/statements/pgq.y#L402C2-L402C2)

Dtenwolde commented 4 months ago

Full test case:

# name: test/sql/path_finding/top_k.test
# group: [duckpgq]

require duckpgq

statement ok
CREATE TABLE Student(id BIGINT, name VARCHAR); INSERT INTO Student VALUES (0, 'Daniel'), (1, 'Tavneet'), (2, 'Gabor'), (3, 'Peter'), (4, 'David');

statement ok
CREATE TABLE know(src BIGINT, dst BIGINT, createDate BIGINT); INSERT INTO know VALUES (0,1, 10), (0,2, 11), (0,3, 12), (3,0, 13), (1,2, 14), (1,3, 15), (2,3, 16), (4,3, 17);

statement ok
-CREATE PROPERTY GRAPH pg
VERTEX TABLES (
    Student LABEL person
    )
EDGE TABLES (
    know    SOURCE KEY ( src ) REFERENCES Student ( id )
            DESTINATION KEY ( dst ) REFERENCES Student ( id )
            label knows
    );

statement ok
-FROM GRAPH_TABLE (pg
        MATCH
        p = ANY SHORTEST 5 WALK (a:Person)-[k:knows]-> *(b:Person)
        WHERE a.name = 'Daniel');
github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.