Closed bburky closed 1 week ago
Hi, thank you for submitting the issue :) I was able to reproduce it using your example. The duplicate IDs in the vertex table seem to lead to an incorrect creation for the CSR index we use for path-finding. I always assumed unique IDs in the vertex table in my tests. If this is not the case it should at least give a nicer error or remove duplicate vertices. I'll look into it :)
Ok, that's what I figured after playing with it a bit more.
Hopefully you'll find a good solution. One of the nice things about the duckdb integration is I could go directly from loading JSON to querying that data in a graph. Sadly duckdb doesn't seem to provide an easy way to put a unique constraint during JSON loading (or when I turn it into a table with CREATE TABLE AS)? I guess I could add a UNIQUE INDEX after creating the table, that may not too bad.
Non unique vertex values (pointed to by DESTINATION KEY (...) REFERENCES ) in graph cause
ANY SHORTEST v-[e]-> +(v)
queries to fail with:Tested on macOS with duckdb v1.0.0 and the current community version of duckpgq (6c06589). Also reproduced with a build from duckpgq-extension source at commit 6d483c583588e353f64aae2c6bdd093c482b9776.
I didn't see any other currently open "INTERNAL Error" issues, so I'm opened this issue. This may be a dupe of the "Primary keys are not unique" issue in #26?
I'm guessing I did something wrong (is the REFERENCES target required to be unique? Edges must point to a single specific vertex? I was able to resolve this by fixing my data and using unique ids for edges) I didn't expect this error to cause be a fatal internal error though.
This project looks really promising, I was just hoping to try it out and play with SQL/PGQ a bit. The integration with duckdb is very nice.
Minimal reproduction: