Fixes #139
This PR now ensures an error is thrown when non-unique vertices are detected during the creation of the CSR. We verify if the sum of the create_csr_vertex UDF equals the number of edges in the edge table. If this is not the case, it points to duplicate edges, causing the sum to be larger than the edge count.
The following error will be thrown:
Constraint Error: Non-unique vertices detected. Make sure all vertices are unique for path-finding queries.
Other options that were considered:
Ensuring all vertices are unique during CSR creation. But this required recalculating rowids, which made the queries more complex.
Adding constraints during property graph creation, ensuring the vertex and edge tables have foreign key-primary key relationships. But since DuckDB is an OLAP system and users often don't define these relationships, I opted to not require these relationships.
Fixes #139 This PR now ensures an error is thrown when non-unique vertices are detected during the creation of the CSR. We verify if the sum of the
create_csr_vertex
UDF equals the number of edges in the edge table. If this is not the case, it points to duplicate edges, causing the sum to be larger than the edge count.The following error will be thrown:
Constraint Error: Non-unique vertices detected. Make sure all vertices are unique for path-finding queries.
Other options that were considered: