Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when MATCH used in subquery #199

Open
2 tasks done
Dtenwolde opened this issue Jan 19, 2025 · 0 comments · May be fixed by #201
Open
2 tasks done

Segmentation fault when MATCH used in subquery #199

Dtenwolde opened this issue Jan 19, 2025 · 0 comments · May be fixed by #201

Comments

@Dtenwolde
Copy link
Contributor

What happens?

Whenever a MATCH statement is used inside a subquery, the query produces a segmentation fault.
Trivial example that fails:

-select * from (select id, id_1 from graph_table ( pg match (p:person)-[k:know]->(p2:person) columns (p.id, p2.id)));

Within duckpgq_find_match_function we should add an explicit check for SubqueryRef to find the MATCH statement.

To Reproduce

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

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

CREATE TABLE School(name VARCHAR, Id BIGINT, Kind VARCHAR);INSERT INTO School VALUES ('VU', 0, 'University'), ('UVA', 1, 'University');

CREATE TABLE StudyAt(personId BIGINT, schoolId BIGINT);INSERT INTO StudyAt VALUES (0, 0), (1, 0), (2, 1), (3, 1), (4, 1);

CREATE PROPERTY GRAPH pg
VERTEX TABLES (
    Student PROPERTIES ( id, name ) LABEL Person,
    School LABEL SCHOOL
    )
EDGE TABLES (
    know    SOURCE KEY ( src ) REFERENCES Student ( id )
            DESTINATION KEY ( dst ) REFERENCES Student ( id ),
    studyAt SOURCE KEY ( personId ) REFERENCES Student ( id )
            DESTINATION KEY ( SchoolId ) REFERENCES School ( id )
    );

select * from (select id, id_1 from graph_table ( pg match (p:person)-[k:know]->(p2:person) columns (p.id, p2.id)));

OS:

MacOS M1

DuckDB Version:

v1.1.3

DuckDB Client:

CLI

Full Name:

Daniel ten Wolde

Affiliation:

CWI

How did you load the extension?

Built from source

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant