duckpgq-extension icon indicating copy to clipboard operation
duckpgq-extension copied to clipboard

Seg fault when doing TopK queries

Open Dtenwolde opened this issue 1 year ago • 1 comments

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 avatar Jul 17 '23 14:07 Dtenwolde

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');

Dtenwolde avatar Jul 03 '24 09:07 Dtenwolde

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.

github-actions[bot] avatar Oct 02 '24 00:10 github-actions[bot]