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

Incorrectly throwing error when using label #154

Closed Dtenwolde closed 3 weeks ago

Dtenwolde commented 3 weeks ago

What happens?

Whenever a custom label is defined for a vertex table, the graph algorithms incorrectly throw an error when we try to use this label as the source for the algorithm.

-CREATE PROPERTY GRAPH pg_all_properties
VERTEX TABLES (
    Student label Person,
    School  LABEL School IN School_kind (Hogeschool, University)
    )
EDGE TABLES (
    know    SOURCE KEY ( src ) REFERENCES Student ( id )
            DESTINATION KEY ( dst ) REFERENCES Student ( id )
            LABEL Knows
    )

statement ok
select * from local_clustering_coefficient(pg_all_properties, person, knows);

Person should be allowed here as the documentation says the vertex label is used, but this throws an error.

To Reproduce

CREATE TABLE Student(id BIGINT, name VARCHAR);
CREATE TABLE know(src BIGINT, dst BIGINT, createDate BIGINT);
CREATE TABLE School(school_name VARCHAR, school_id BIGINT, school_kind BIGINT);
INSERT INTO Student VALUES (0, 'Daniel'), (1, 'Tavneet'), (2, 'Gabor'), (3, 'Peter');
INSERT INTO know VALUES (0,1, 10), (0,2, 11), (0,3, 12), (1,2, 14), (1,3, 15), (2,3, 16);
-CREATE PROPERTY GRAPH pg_all_properties
VERTEX TABLES (
    Student label person,
    School  LABEL School IN School_kind (Hogeschool, University)
    )
EDGE TABLES (
    know    SOURCE KEY ( src ) REFERENCES Student ( id )
            DESTINATION KEY ( dst ) REFERENCES Student ( id )
            LABEL Knows
    )

select * from local_clustering_coefficient(pg_all_properties, person, knows);

OS:

macOs 13 - Apple M1 Pro

DuckDB Version:

v1.1.2

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?