cwida / duckpgq-extension

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

Parser error with any shortest in wrong place #145

Open Dtenwolde opened 2 months ago

Dtenwolde commented 2 months ago

What happens?

A segmentation fault occurs in pgq.y with the following query:

-FROM GRAPH_TABLE (g
    MATCH ANY SHORTEST p = (src:Student WHERE src.id = 10)-[k:knows]-> *(dst:Student)
    COLUMNS (element_id(p) AS path));

To Reproduce

create table student(id INT); INSERT INTO student(id) VALUES (10), (20), (30), (40);

create table know(src INT, dst INT); INSERT INTO know(src, dst) VALUES (40, 20), (10,30), (10,10), (20,10), (30,10);

-CREATE PROPERTY GRAPH g
VERTEX TABLES (student)
EDGE TABLES (know    SOURCE KEY ( src ) REFERENCES Student ( id )
                         DESTINATION KEY ( dst ) REFERENCES Student ( id )
                         );

-FROM GRAPH_TABLE (g
    MATCH ANY SHORTEST p = (src:Student WHERE src.id = 10)-[k:knows]-> *(dst:Student)
    COLUMNS (element_id(p) AS path));

OS:

macOs 13 - Apple M1 Pro

DuckDB Version:

v1.0.0

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?

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