It appears that a graph with no edges is treated the same as "no graph has been generated". This becomes an issue when trying to match a shortest path, causing the error "Constraint Error: Need to initialize CSR before doing shortest path" to be thrown.
I discovered this issue while trying to run automated tests on duckpgq using randomly generated graphs (hence the absurd existence of a graph without edges).
To Reproduce
force install duckpgq from community;
load duckpgq;
CREATE TABLE nodes (id INTEGER);
CREATE TABLE edges (src INTEGER, dst INTEGER);
INSERT INTO nodes VALUES (1), (2), (3);
CREATE PROPERTY GRAPH testgraph
VERTEX TABLES (
nodes LABEL N
)
EDGE TABLES (
edges SOURCE KEY (src) REFERENCES nodes (id)
DESTINATION KEY (dst) REFERENCES nodes (id)
LABEL E
);
FROM GRAPH_TABLE(testgraph
MATCH p = ANY SHORTEST (n1:N)-[e:E]-> * (n2:N)
COLUMNS (edges(p) AS path_edges)
);
OS:
Ubuntu 20.04.6 LTS (x86_64)
DuckDB Version:
1.1.0
DuckDB Client:
CLI (initially discovered using the Go driver)
Full Name:
Alexandra Rogova
Affiliation:
IRIF, Université Paris Cité
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?
[X] Yes, I have
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
What happens?
Hello,
It appears that a graph with no edges is treated the same as "no graph has been generated". This becomes an issue when trying to match a shortest path, causing the error "Constraint Error: Need to initialize CSR before doing shortest path" to be thrown.
I discovered this issue while trying to run automated tests on duckpgq using randomly generated graphs (hence the absurd existence of a graph without edges).
To Reproduce
OS:
Ubuntu 20.04.6 LTS (x86_64)
DuckDB Version:
1.1.0
DuckDB Client:
CLI (initially discovered using the Go driver)
Full Name:
Alexandra Rogova
Affiliation:
IRIF, Université Paris Cité
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?