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

Syntax error at or near ->* #146

Open Dtenwolde opened 2 months ago

Dtenwolde commented 2 months ago

What happens?

A query with an * or + directly attached to the -> results in a syntax error.

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 p = ANY SHORTEST (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?

Community extension version

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?

Dtenwolde commented 2 months ago

The workaround for now is to separate the -> and * with a space: -> * or -> +.